Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor!: rename project to perimeter as preparation for upcoming features #1446

Merged
merged 16 commits into from
Feb 5, 2025

Conversation

eric-intuitem
Copy link
Collaborator

@eric-intuitem eric-intuitem commented Jan 28, 2025

Better to do that before PMBOK project management

Summary by CodeRabbit

  • User Interface & Terminology Update

    • The application’s user-facing language has been rebranded: all references to “Projects” are now presented as “Perimeters” across menus, forms, and notifications.
  • Updated Documentation & Messaging

    • In-app help texts, tooltips, and multilingual messages have been revised to reflect the new “Perimeter” terminology, ensuring a consistent and unified user experience.
  • New Features

    • Introduced new API endpoints for managing Perimeters, replacing the previous Project endpoints.
  • Data Model Changes

    • Transitioned from a project-centric model to a perimeter-centric model, affecting various data structures and relationships throughout the application.
  • Testing Enhancements

    • Updated test cases to reflect the new Perimeter model, ensuring comprehensive coverage for the modified functionality.

Copy link

coderabbitai bot commented Jan 28, 2025

Walkthrough

The pull request refactors the codebase by replacing all references to “Project” with “Perimeter.” This involves changes in models, tests, serializers, views, management commands, CLI commands, localization files, and frontend components. The update adjusts endpoints, permissions, fixtures, and templates to align with a perimeter-centric model instead of a project-centric one, ensuring consistency across both backend and frontend functionality.

Changes

File(s) Change Summary
backend/app_tests/api/test_api_compliance_assessments.py, backend/app_tests/api/test_api_perimeters.py, backend/app_tests/api/test_api_requirement_assessments.py, backend/app_tests/api/test_api_risk_acceptances.py, backend/app_tests/api/test_api_risk_assessments.py, backend/app_tests/api/test_api_risk_scenarios.py, backend/app_tests/test_vars.py Updated test cases and fixtures: Renamed "Project" to "Perimeter" in test methods, parameters, and assertions to reflect the new model.
backend/core/base_models.py, backend/core/filters.py, backend/core/helpers.py, backend/core/locale/fr/LC_MESSAGES/django.po, backend/core/management/commands/status.py, backend/core/models.py, backend/core/serializers.py, backend/core/startup.py, backend/core/templates/**/* Core refactoring: Renamed the model and all related references from "Project" to "Perimeter", updated foreign keys, filtering, permissions, and template variables.
backend/iam/models.py, backend/iam/tests/test_user.py Adjusted object navigation and user permissions: Updated folder navigation paths and fixtures from project-based to perimeter-based.
backend/tprm/migrations/0004_remove_entityassessment_project_and_more.py, backend/tprm/serializers.py, backend/tprm/views.py Modified EntityAssessment: Removed the "project" field; added a “perimeter” foreign key linking to the new Perimeter model.
cli/clica.py CLI command updates: Renamed get_projects to get_perimeters and updated function parameters from project to perimeter.
frontend/src/**/*, frontend/messages/**/*, frontend/tests/**/* Frontend refactoring: Replaced project references with perimeter in components, routes, localization JSON files, navigation data, and test utilities to update API endpoints, UI labels, and permission checks.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant APIEndpoint
    participant PerimeterViewSet
    participant PerimeterModel
    Client->>APIEndpoint: Request perimeter data
    APIEndpoint->>PerimeterViewSet: Forward request
    PerimeterViewSet->>PerimeterModel: Query Perimeter objects
    PerimeterModel-->>PerimeterViewSet: Return perimeter results
    PerimeterViewSet-->>APIEndpoint: Format response
    APIEndpoint-->>Client: Return data with perimeter fields
Loading

Suggested labels

perf

Suggested reviewers

  • ab-smith
  • Mohamed-Hacene

Poem

I'm a little rabbit with a skip and a hop,
Watching code transform, I can't help but stop.
Projects are now perimeters, neat and clear,
Hopping over tests with a joyful cheer.
Carrot codes crunch and bugs go astray,
Hoppy refactors brighten our workday!
🐰✨

Tip

🌐 Web search-backed reviews and chat
  • We have enabled web search-based reviews and chat for all users. This feature allows CodeRabbit to access the latest documentation and information on the web.
  • You can disable this feature by setting web_search: false in the knowledge_base settings.
  • Please share any feedback in the Discord discussion.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@eric-intuitem eric-intuitem changed the title refactor project -> perimeter be refactor project -> perimeter Jan 28, 2025
@eric-intuitem eric-intuitem changed the title refactor project -> perimeter feat: refactor project -> perimeter Jan 28, 2025
@ab-smith ab-smith changed the title feat: refactor project -> perimeter feat!: rename project to perimeter to make room for upcoming new features Jan 28, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 10

🧹 Nitpick comments (13)
frontend/messages/nl.json (1)

212-213: Consider refining the term "perimeteren".

The translations are generally good, but the term "perimeteren" (verb form of "perimeter") in the composer description might be unclear to users. Consider using a more natural Dutch phrase.

Suggested revision:

-"Dit zal je helpen meerdere componenten (perimeteren) samen te voegen"
+"Dit zal je helpen meerdere componenten (perimeters) samen te voegen"
backend/core/tests/test_models.py (2)

101-101: Consider using a shared fixture for perimeter creation.
This line is repeated in multiple tests. Centralizing it in a fixture can reduce duplication and keep tests consistent.


315-315: Creating a second perimeter.
Consider a fixture for multiple perimeter creation.

backend/core/views.py (3)

251-251: Avoid potential F405 warnings by explicitly importing Perimeter.

Star imports may lead to undefined references or overriding. Import Perimeter directly to enhance readability and avoid static analysis warnings.

-from .models import *
+from .models import Perimeter, ...
🧰 Tools
🪛 Ruff (0.8.2)

251-251: Perimeter may be undefined, or defined from star imports

(F405)


257-257: Consider renaming PRJ_LC_STATUS for clarity.

This attribute name still references "project." For consistency, rename it to something perimeter-specific, e.g. LC_STATUS.

-return Response(dict(Perimeter.PRJ_LC_STATUS))
+return Response(dict(Perimeter.LC_STATUS))
🧰 Tools
🪛 Ruff (0.8.2)

257-257: Perimeter may be undefined, or defined from star imports

(F405)


277-277: Import PerimeterReadSerializer explicitly to avoid star import pitfalls.

Star imports could cause confusion in large files. Consider using a direct import for better clarity.

-from .serializers import *
+from .serializers import PerimeterReadSerializer, ...
🧰 Tools
🪛 Ruff (0.8.2)

277-277: PerimeterReadSerializer may be undefined, or defined from star imports

(F405)

backend/core/management/commands/status.py (1)

Line range hint 2-2: Consider replacing star imports with explicit imports.

Using star imports (from core.models import *) makes it harder to track dependencies and could lead to naming conflicts.

-from core.models import *
+from core.models import (
+    Perimeter, LoadedLibrary, Asset, Threat,
+    ReferenceControl, AppliedControl, Evidence,
+    ComplianceAssessment, RiskAssessment,
+    RiskScenario, RiskAcceptance
+)
🧰 Tools
🪛 Ruff (0.8.2)

13-13: LoadedLibrary may be undefined, or defined from star imports

(F405)


15-15: Perimeter may be undefined, or defined from star imports

(F405)


16-16: Asset may be undefined, or defined from star imports

(F405)


17-17: Threat may be undefined, or defined from star imports

(F405)


18-18: ReferenceControl may be undefined, or defined from star imports

(F405)

backend/core/tests/test_requirement_assessment.py (1)

7-7: LGTM! Consider adding migration-specific tests.

The test changes correctly reflect the transition from projects to perimeters. Consider adding specific tests to verify that existing data is correctly migrated from projects to perimeters.

Example test to add:

def test_project_to_perimeter_migration():
    # Create a compliance assessment with old project structure
    # Run migration
    # Verify data integrity and relationships are maintained
    pass

Also applies to: 28-30, 39-39

backend/core/tests/test_helpers.py (1)

Line range hint 1-1: Consider replacing star imports with explicit imports.

The static analysis tool flags multiple undefined classes from star imports. Consider replacing:

from core.models import *

with explicit imports to improve code maintainability and avoid potential naming conflicts.

-from core.models import *
+from core.models import (
+    Perimeter,
+    RiskAssessment,
+    RiskMatrix,
+    RiskScenario,
+    StoredLibrary,
+)
🧰 Tools
🪛 Ruff (0.8.2)

39-39: Folder may be undefined, or defined from star imports

(F405)


39-39: Folder may be undefined, or defined from star imports

(F405)


41-41: Perimeter may be undefined, or defined from star imports

(F405)


42-42: RiskAssessment may be undefined, or defined from star imports

(F405)


45-45: RiskMatrix may be undefined, or defined from star imports

(F405)


47-47: RiskScenario may be undefined, or defined from star imports

(F405)


48-48: Role may be undefined, or defined from star imports

(F405)


49-49: Permission may be undefined, or defined from star imports

(F405)

frontend/src/routes/(app)/(internal)/recap/+page.server.ts (1)

Line range hint 96-108: Consider optimizing the data aggregation logic.

The nested loops for data aggregation could be optimized for better performance.

Consider this optimization:

-			perimeter.compliance_assessments.forEach((compliance_assessment: Record<string, any>) => {
-				compliance_assessment.donut.result.values.forEach(
-					(donutItem: RequirementAssessmentDonutItem) => {
+			const aggregatedValues = perimeter.compliance_assessments.reduce((acc, assessment) => {
+				assessment.donut.result.values.forEach((donutItem: RequirementAssessmentDonutItem) => {
+					const existing = acc.get(donutItem.name) || { ...donutItem, value: 0 };
+					existing.value += donutItem.value;
+					acc.set(donutItem.name, existing);
+				});
+				return acc;
+			}, new Map<string, RequirementAssessmentDonutItem>());
+			
+			aggregatedDonutData.values = Array.from(aggregatedValues.values());

Also applies to: 135-141

backend/core/urls.py (1)

Line range hint 1-1: Consider making imports explicit.

Instead of using star imports (from .views import *), consider explicitly importing PerimeterViewSet and other required view classes. This improves code maintainability and helps avoid potential naming conflicts.

-from .views import *
+from .views import (
+    FolderViewSet,
+    PerimeterViewSet,
+    RiskMatrixViewSet,
+    # ... other required view classes
+)
🧰 Tools
🪛 Ruff (0.8.2)

26-26: PerimeterViewSet may be undefined, or defined from star imports

(F405)


27-27: RiskMatrixViewSet may be undefined, or defined from star imports

(F405)


28-28: VulnerabilityViewSet may be undefined, or defined from star imports

(F405)


29-29: RiskAssessmentViewSet may be undefined, or defined from star imports

(F405)

backend/app_tests/api/test_api_perimeters.py (1)

12-12: Fix typo in PERIMETER_REFERENCE constant.

The constant PERIMETER_REFERENCE contains a typo: "test:perimter" should be "test:perimeter".

-PERIMETER_REFERENCE = "test:perimter"
+PERIMETER_REFERENCE = "test:perimeter"
frontend/tests/functional/user-route.test.ts (1)

34-47: Add table data assertion for perimeter creation.

The test step for perimeter creation is well-structured, but the TODO comment indicates missing verification of the created perimeter in the table.

Consider adding this assertion after perimeter creation:

 await pages.perimetersPage.createItem({
   name: vars.perimeterName,
   description: vars.description,
   folder: vars.folderName,
   ref_id: 'R.1234',
   lc_status: 'Production'
 });

-//TODO assert that the perimeter data are displayed in the table
+await expect(page.getByRole('row', { name: vars.perimeterName })).toBeVisible();
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4a867cf and 4c8a508.

📒 Files selected for processing (87)
  • backend/app_tests/api/test_api_compliance_assessments.py (12 hunks)
  • backend/app_tests/api/test_api_perimeters.py (1 hunks)
  • backend/app_tests/api/test_api_projects.py (0 hunks)
  • backend/app_tests/api/test_api_requirement_assessments.py (6 hunks)
  • backend/app_tests/api/test_api_risk_acceptances.py (3 hunks)
  • backend/app_tests/api/test_api_risk_assessments.py (15 hunks)
  • backend/app_tests/api/test_api_risk_scenarios.py (9 hunks)
  • backend/app_tests/test_vars.py (1 hunks)
  • backend/core/base_models.py (1 hunks)
  • backend/core/filters.py (5 hunks)
  • backend/core/helpers.py (9 hunks)
  • backend/core/locale/fr/LC_MESSAGES/django.po (3 hunks)
  • backend/core/management/commands/status.py (2 hunks)
  • backend/core/migrations/0050_rename_project_perimeter_alter_perimeter_options_and_more.py (1 hunks)
  • backend/core/models.py (10 hunks)
  • backend/core/serializers.py (9 hunks)
  • backend/core/startup.py (11 hunks)
  • backend/core/templates/core/action_plan_pdf.html (1 hunks)
  • backend/core/templates/snippets/mp_data.html (1 hunks)
  • backend/core/templates/snippets/ra_data.html (1 hunks)
  • backend/core/tests/fixtures.py (2 hunks)
  • backend/core/tests/test_helpers.py (2 hunks)
  • backend/core/tests/test_models.py (35 hunks)
  • backend/core/tests/test_requirement_assessment.py (3 hunks)
  • backend/core/tests/test_vulnerability.py (4 hunks)
  • backend/core/urls.py (1 hunks)
  • backend/core/views.py (12 hunks)
  • backend/ebios_rm/serializers.py (1 hunks)
  • backend/iam/models.py (1 hunks)
  • backend/iam/tests/test_user.py (5 hunks)
  • backend/serdes/tests/test_dump.py (1 hunks)
  • backend/serdes/utils.py (8 hunks)
  • backend/tprm/migrations/0004_remove_entityassessment_project_and_more.py (1 hunks)
  • backend/tprm/serializers.py (2 hunks)
  • backend/tprm/views.py (1 hunks)
  • cli/clica.py (4 hunks)
  • enterprise/frontend/src/lib/components/SideBar/navData.ts (6 hunks)
  • frontend/messages/ar.json (6 hunks)
  • frontend/messages/cs.json (6 hunks)
  • frontend/messages/de.json (6 hunks)
  • frontend/messages/en.json (9 hunks)
  • frontend/messages/es.json (6 hunks)
  • frontend/messages/fr.json (7 hunks)
  • frontend/messages/hi.json (6 hunks)
  • frontend/messages/id.json (6 hunks)
  • frontend/messages/it.json (6 hunks)
  • frontend/messages/nl.json (8 hunks)
  • frontend/messages/pl.json (6 hunks)
  • frontend/messages/pt.json (6 hunks)
  • frontend/messages/ro.json (6 hunks)
  • frontend/messages/sv.json (6 hunks)
  • frontend/messages/ur.json (6 hunks)
  • frontend/src/lib/components/DetailView/DetailView.svelte (1 hunks)
  • frontend/src/lib/components/Forms/ModelForm.svelte (2 hunks)
  • frontend/src/lib/components/Forms/ModelForm/ComplianceAssessmentForm.svelte (1 hunks)
  • frontend/src/lib/components/Forms/ModelForm/EntityAssessmentForm.svelte (1 hunks)
  • frontend/src/lib/components/Forms/ModelForm/RiskAcceptanceForm.svelte (1 hunks)
  • frontend/src/lib/components/Forms/ModelForm/RiskAssessmentForm.svelte (1 hunks)
  • frontend/src/lib/components/Forms/ModelForm/RiskScenarioForm.svelte (1 hunks)
  • frontend/src/lib/components/SideBar/SideBar.svelte (1 hunks)
  • frontend/src/lib/components/SideBar/navData.ts (3 hunks)
  • frontend/src/lib/utils/crud.ts (7 hunks)
  • frontend/src/lib/utils/schemas.ts (5 hunks)
  • frontend/src/lib/utils/table.ts (7 hunks)
  • frontend/src/lib/utils/types.ts (2 hunks)
  • frontend/src/routes/(app)/(internal)/[model=urlmodel]/[id=uuid]/+page.server.ts (1 hunks)
  • frontend/src/routes/(app)/(internal)/analytics/+page.server.ts (2 hunks)
  • frontend/src/routes/(app)/(internal)/analytics/+page.svelte (2 hunks)
  • frontend/src/routes/(app)/(internal)/analytics/ComposerSelect.svelte (1 hunks)
  • frontend/src/routes/(app)/(internal)/analytics/composer/+page.svelte (1 hunks)
  • frontend/src/routes/(app)/(internal)/compliance-assessments/[id=uuid]/action-plan/+page.svelte (1 hunks)
  • frontend/src/routes/(app)/(internal)/recap/+page.server.ts (6 hunks)
  • frontend/src/routes/(app)/(internal)/recap/+page.svelte (2 hunks)
  • frontend/src/routes/(app)/(internal)/risk-assessments/[id=uuid]/+page.svelte (1 hunks)
  • frontend/src/routes/(app)/(internal)/risk-assessments/[id=uuid]/remediation-plan/+page.svelte (1 hunks)
  • frontend/src/routes/(app)/(internal)/risk-scenarios/[id=uuid]/+page.svelte (1 hunks)
  • frontend/src/routes/(app)/(internal)/risk-scenarios/[id=uuid]/edit/+page.server.ts (1 hunks)
  • frontend/src/routes/(app)/(internal)/risk-scenarios/[id=uuid]/edit/+page.svelte (1 hunks)
  • frontend/src/routes/(app)/(internal)/x-rays/+page.server.ts (1 hunks)
  • frontend/src/routes/(app)/(internal)/x-rays/+page.svelte (4 hunks)
  • frontend/src/routes/(app)/(third-party)/compliance-assessments/[id=uuid]/+page.svelte (1 hunks)
  • frontend/tests/functional/detailed/common.test.ts (2 hunks)
  • frontend/tests/functional/detailed/compliance-assessments.test.ts (1 hunks)
  • frontend/tests/functional/user-route.test.ts (5 hunks)
  • frontend/tests/utils/page-detail.ts (1 hunks)
  • frontend/tests/utils/test-data.ts (11 hunks)
  • frontend/tests/utils/test-utils.ts (11 hunks)
💤 Files with no reviewable changes (1)
  • backend/app_tests/api/test_api_projects.py
🧰 Additional context used
🪛 Ruff (0.8.2)
backend/core/management/commands/status.py

15-15: Perimeter may be undefined, or defined from star imports

(F405)

backend/core/tests/test_helpers.py

41-41: Perimeter may be undefined, or defined from star imports

(F405)


42-42: RiskAssessment may be undefined, or defined from star imports

(F405)


45-45: RiskMatrix may be undefined, or defined from star imports

(F405)


47-47: RiskScenario may be undefined, or defined from star imports

(F405)


48-48: Role may be undefined, or defined from star imports

(F405)


49-49: Permission may be undefined, or defined from star imports

(F405)


106-106: Perimeter may be undefined, or defined from star imports

(F405)


107-107: RiskAssessment may be undefined, or defined from star imports

(F405)


110-110: RiskMatrix may be undefined, or defined from star imports

(F405)


112-112: RiskScenario may be undefined, or defined from star imports

(F405)


113-113: Role may be undefined, or defined from star imports

(F405)


114-114: Permission may be undefined, or defined from star imports

(F405)

backend/core/urls.py

26-26: PerimeterViewSet may be undefined, or defined from star imports

(F405)

backend/serdes/utils.py

80-80: Redefinition of unused Perimeter from line 19

Remove definition: Perimeter

(F811)


109-109: Redefinition of unused PerimeterImportExportSerializer from line 48

Remove definition: PerimeterImportExportSerializer

(F811)

backend/core/helpers.py

166-166: Perimeter may be undefined, or defined from star imports

(F405)


774-774: Perimeter may be undefined, or defined from star imports

(F405)


807-807: Perimeter may be undefined, or defined from star imports

(F405)


810-810: ComplianceAssessment may be undefined, or defined from star imports

(F405)


1183-1183: Perimeter may be undefined, or defined from star imports

(F405)


1190-1190: ComplianceAssessment may be undefined, or defined from star imports

(F405)


1196-1196: RiskAssessment may be undefined, or defined from star imports

(F405)

backend/core/views.py

251-251: Perimeter may be undefined, or defined from star imports

(F405)


257-257: Perimeter may be undefined, or defined from star imports

(F405)


262-262: Perimeter may be undefined, or defined from star imports

(F405)


272-272: Perimeter may be undefined, or defined from star imports

(F405)


274-274: Perimeter may be undefined, or defined from star imports

(F405)


277-277: PerimeterReadSerializer may be undefined, or defined from star imports

(F405)


309-309: Perimeter may be undefined, or defined from star imports

(F405)


314-314: PerimeterReadSerializer may be undefined, or defined from star imports

(F405)


345-345: Perimeter may be undefined, or defined from star imports

(F405)


347-347: Perimeter may be undefined, or defined from star imports

(F405)


980-980: Perimeter may be undefined, or defined from star imports

(F405)


2596-2596: Perimeter may be undefined, or defined from star imports

(F405)


2611-2611: Perimeter may be undefined, or defined from star imports

(F405)

backend/core/serializers.py

210-210: Perimeter may be undefined, or defined from star imports

(F405)


219-219: Perimeter may be undefined, or defined from star imports

(F405)


227-227: Perimeter may be undefined, or defined from star imports

(F405)

⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: startup-docker-compose-test
  • GitHub Check: functional-tests (3.12, chromium)
  • GitHub Check: build (3.12)
  • GitHub Check: enterprise-startup-docker-compose-test
  • GitHub Check: test (3.12)
  • GitHub Check: enterprise-functional-tests (3.12, chromium)
🔇 Additional comments (233)
frontend/messages/nl.json (5)

28-28: Basic term translations look good!

The translations for "perimeter" related terms are consistent and correctly follow Dutch language rules.

Also applies to: 41-41, 81-81


119-119: Single term translation is correct!

The technical term "perimeter" is appropriately kept as-is in the Dutch translation.


187-187: UI text translations with variable interpolation are correct!

The translations maintain proper Dutch grammar and correctly preserve the variable interpolation.

Also applies to: 189-189


224-224: Summary text translation is accurate!

The empty state message is correctly translated and follows the same pattern as other similar messages in the file.


756-756: Error message translation is well-formed!

The translation maintains a formal tone and correctly uses Dutch technical terminology.

frontend/src/lib/utils/crud.ts (9)

155-155: Good job on renaming the reverseForeignKeyFields.

This change is consistent with the updated perimeter-centric architecture.


159-170: New perimeters entry looks coherent.

The fields and naming convention align well with the perimeter-based model. No concerns regarding consistency or readability.


193-193: Renaming the foreign key reference to perimeter is correct.

This aligns with the perimeter refactor.


210-210: Foreign key fields renamed to perimeter.

This matches the new model structure and fosters consistency.


235-235: Foreign key field referencing perimeters is correct.

No issues found.


468-468: Compliance-assessments referencing perimeters.

This ensures consistent naming and avoids confusion.


563-563: Entity-assessments pointing to perimeter.

Rename is uniform across the codebase.


880-880: New perimeters entry in FIELD_COLORED_TAG_MAP.

All references align with perimeter-based model. The color mapping seems straightforward.


202-202: Filters updated to include perimeter.

Ensure any code referencing the old project filter key has been updated accordingly.

backend/core/serializers.py (10)

214-219: PerimeterReadSerializer logic looks sound.

Including folder and lc_status ensures completeness of perimeter data retrieval.

🧰 Tools
🪛 Ruff (0.8.2)

219-219: Perimeter may be undefined, or defined from star imports

(F405)


223-227: PerimeterImportExportSerializer properly reflects the perimeter design.

Looks consistent with the existing serializer patterns.

🧰 Tools
🪛 Ruff (0.8.2)

227-227: Perimeter may be undefined, or defined from star imports

(F405)


248-248: Field list updated to include perimeter.

Change is consistent with the perimeter refactor in RiskAssessmentDuplicateSerializer.


253-253: Replacing project with perimeter in RiskAssessmentReadSerializer.

Ensures references match the new data model.


Line range hint 269-280: RiskAssessmentImportExportSerializer uses perimeter field.

The slug-based approach for read-only references is maintained. No issues.


462-463: RiskScenarioReadSerializer reading from risk_assessment.perimeter.

Field rename is aligned with the rest of the code.


864-864: perimeter field in ComplianceAssessmentReadSerializer.

Smooth transition from the old project field.


Line range hint 916-926: ComplianceAssessmentImportExportSerializer referencing perimeter.

Renaming is consistent with other import/export serializers.

🧰 Tools
🪛 Ruff (0.8.2)

919-919: ComplianceAssessment may be undefined, or defined from star imports

(F405)


208-210: Introduced PerimeterWriteSerializer.

Static analysis warns that Perimeter may be from a star import. Confirm that Perimeter is defined in core.models.

✅ Verification successful

Star import confirmed, consider explicit import

The Perimeter model is correctly defined in core.models.py, but it's currently imported via from core.models import *. Consider replacing the star import with an explicit import for better code maintainability:

from core.models import Perimeter
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Verifying that Perimeter is declared in core/models.py
ast-grep --pattern $'class Perimeter($_) {\n  $$$\n}' 

Length of output: 52


Script:

#!/bin/bash
# Search for Perimeter class definition
rg "class Perimeter" -A 2

# Check imports in serializers.py
rg "from .* import .*Perimeter" backend/core/serializers.py

# Look specifically in models.py
cat backend/core/models.py | grep -A 5 "class Perimeter"

Length of output: 1729


Script:

#!/bin/bash
# Check all imports at the top of serializers.py
rg "^from|^import" backend/core/serializers.py

Length of output: 509

🧰 Tools
🪛 Ruff (0.8.2)

210-210: Perimeter may be undefined, or defined from star imports

(F405)


111-111: perimeter field in AssessmentReadSerializer.

Change from project to perimeter is coherent. Confirm that any usage of .project in templates or business logic is updated.

✅ Verification successful

Field change from project to perimeter is properly implemented

The change is coherent across the codebase. The field is consistently defined in the base AssessmentReadSerializer and properly extended in child serializers. No problematic usages of .project were found in the serializer context or related code.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Searching for leftover references to AssessmentReadSerializer.project
rg 'AssessmentReadSerializer' -A 10 | rg '\.project'

Length of output: 52


Script:

#!/bin/bash
# Find AssessmentReadSerializer usages with context
echo "=== AssessmentReadSerializer usages ==="
rg -l "AssessmentReadSerializer"

echo -e "\n=== Template files with 'project' ==="
fd -e html -e django-html | xargs rg "project"

echo -e "\n=== Python files with Assessment and project ==="
rg -l "class.*Assessment" | xargs rg "project" -C 3

Length of output: 102428


Script:

#!/bin/bash
# Find AssessmentReadSerializer implementation and usage
echo "=== AssessmentReadSerializer implementation ==="
rg -A 10 -B 5 "class AssessmentReadSerializer" 

echo -e "\n=== AssessmentReadSerializer usage ==="
rg "AssessmentReadSerializer\(" -A 3

Length of output: 5343

backend/core/helpers.py (10)

120-122: Renamed to compile_perimeter_for_composer.

Docstring matches the new implementation. This is in line with the perimeter-based refactor.


139-139: Filtering by compliance_assessment__perimeter__in=perimeters_list.

Filter logic is correct and consistent with the rename.


156-156: requirement_assessments__assessment__perimeter__in=perimeters_list.

Ensures correct composition scope.


163-167: Building perimeter_objects array.

Retrieving Perimeter via primary key is aligned with the rest of the flow.

🧰 Tools
🪛 Ruff (0.8.2)

166-166: Perimeter may be undefined, or defined from star imports

(F405)


170-170: Returning perimeter_objects in the final dict.

Ensures consumers can process the new perimeter-based data set.


Line range hint 740-752: risks_per_perimeter_groups: new perimeter-based grouping.

Filtering by risk_assessment__perimeter__folder=folder is coherent with the new domain/perimeter structure.


772-774: Counters for perimeters.

Accurate rename from projects key to perimeters.

🧰 Tools
🪛 Ruff (0.8.2)

774-774: Perimeter may be undefined, or defined from star imports

(F405)


807-810: Looping over Perimeter.objects and referencing ComplianceAssessment for each.

Logic cleanly fits the perimeter-based flow.

🧰 Tools
🪛 Ruff (0.8.2)

807-807: Perimeter may be undefined, or defined from star imports

(F405)


810-810: ComplianceAssessment may be undefined, or defined from star imports

(F405)


1012-1014: Concatenating risk_assessment.perimeter with version.

Properly references the perimeter as a string. No issues found.


1183-1190: get_folder_content updated for Perimeter references.

Switched from counting by project to counting by perimeter. Flow is well-aligned with the new model.

Also applies to: 1191-1192, 1196-1196

🧰 Tools
🪛 Ruff (0.8.2)

1183-1183: Perimeter may be undefined, or defined from star imports

(F405)


1190-1190: ComplianceAssessment may be undefined, or defined from star imports

(F405)

backend/core/tests/test_models.py (54)

8-8: Thanks for updating the import statement to Perimeter.
This aligns with the perimeter-centric model.


105-105: Proper reference of perimeter.
This replacement from project to perimeter is consistent with the rename.


111-111: Good assertion for verifying perimeter.
Ensures that the risk assessment references the correct perimeter.


128-128: Repeated perimeter creation.
Same suggestion as line 101 to consider a shared fixture or factory.


132-132: Correct perimeter usage.
No issues found.


146-146: Repeated perimeter creation.
Same remark as line 101.


150-150: Perimeter assignment is correct.


172-172: Repeated perimeter creation.
Same remark as line 101.


176-176: Perimeter assignment is correct.


202-202: Repeated perimeter creation.
Same remark as line 101.


206-206: Perimeter assignment remains consistent.


233-233: Repeated perimeter creation.
Same remark as line 101.


237-237: Perimeter assignment is correct.


243-243: Renamed test method
Accurately reflects perimeter-based uniqueness.


253-253: Repeated perimeter creation.
Same remark as line 101.


257-257: Perimeter assignment is correct.


264-264: Perimeter assignment outside fixture
Still consistent with rename.


278-278: Repeated perimeter creation.
Same remark as line 101.


282-282: Perimeter usage is correct.


289-289: Perimeter usage is correct.


294-294: Renamed test method
Accurately verifies usage across different perimeters.


306-306: Repeated perimeter creation.
Same remark as line 101.


310-310: Perimeter assignment is consistent.


319-319: Assigning perimeter2
Ensures coverage of multiple perimeters in tests.


324-324: Renamed test method
Scope now references perimeter instead of project.


334-334: Repeated perimeter creation.
Same remark as line 101.


338-338: Perimeter assignment is correct.


344-344: Perimeter assignment remains consistent.


350-350: Perimeter assignment remains consistent.


354-354: Creating a second perimeter
Consider reusing a fixture for perimeter creation.


358-358: Perimeter assignment referencing perimeter2


364-364: Another perimeter2 assignment


385-385: Repeated perimeter creation
Same remark as line 101.


389-389: Perimeter assignment is correct


410-410: Renamed test scenario method
Focuses on 'parent_perimeter' instead of 'parent_project'.


415-415: Repeated perimeter creation
Same remark as line 101.


419-419: Perimeter assignment is consistent


431-433: Great test verifying parent perimeter
Ensures the scenario returns the correct perimeter from parent_perimeter().


441-441: Repeated perimeter creation
Same remark as line 101.


445-445: Perimeter assignment is consistent


471-471: Repeated perimeter creation
Same remark as line 101.


475-475: Perimeter assignment


502-502: Repeated perimeter creation
Same remark as line 101.


506-506: Perimeter usage


526-526: Repeated perimeter creation
Same remark as line 101.


530-530: Perimeter usage


555-555: Perimeter assignment


Line range hint 566-566: Updated reference to compliance_assessment.perimeter.folder
This is consistent with perimeter-based architecture.


711-711: Repeated perimeter creation
Same remark as line 101.


715-715: Perimeter assignment


750-750: Repeated perimeter creation
Same remark as line 101.


754-754: Perimeter usage


794-794: Repeated perimeter creation
Same remark as line 101.


798-798: Perimeter usage

backend/core/models.py (11)

1351-1351: Introduction of Perimeter model
This is consistent with the perimeter-based refactor.


1373-1373: Updated verbose_name
Accurately reflects the new Perimeter naming.


1374-1374: Updated verbose_name_plural
Ensures consistent Django admin display.


1879-1879: Renamed property
Replaces 'projects' with 'perimeters' to stay consistent with refactor.


1880-1880: Use of set comprehension
Returning distinct perimeters for the AppliedControl.


2042-2046: Switched to referencing Perimeter
Replaces the former project-based foreign key with a perimeter-based approach.


2085-2085: Folder assignment from perimeter
Ensures the newly introduced perimeter is the folder source.


2146-2146: Path display updated
Utilizes perimeter folder path for clarity.


2602-2603: New parent_perimeter method
This method cleanly retrieves the associated perimeter from the risk assessment.


2605-2605: Short description updated
Reflects the 'Perimeter' label in admin.


2706-2706: String representation
Displays perimeter name explicitly with the scenario's name.

backend/core/views.py (13)

246-248: Renaming ProjectViewSet to PerimeterViewSet is consistent.

These lines properly shift the focus from projects to perimeters. The updated docstring clarifies the endpoint’s purpose.


262-262: Query usage looks correct.

Filtering by UUIDs via id__in=uuid_list is a straightforward approach.

🧰 Tools
🪛 Ruff (0.8.2)

262-262: Perimeter may be undefined, or defined from star imports

(F405)


272-274: Access control logic stays consistent with the perimeter-based approach.

No immediate concerns.

🧰 Tools
🪛 Ruff (0.8.2)

272-272: Perimeter may be undefined, or defined from star imports

(F405)


274-274: Perimeter may be undefined, or defined from star imports

(F405)


309-309: Perimeter-based access check is consistent.

No issues found.

🧰 Tools
🪛 Ruff (0.8.2)

309-309: Perimeter may be undefined, or defined from star imports

(F405)


314-314: Same star import concern for PerimeterReadSerializer.

This is a duplicate of the earlier comment about explicit imports.

🧰 Tools
🪛 Ruff (0.8.2)

314-314: PerimeterReadSerializer may be undefined, or defined from star imports

(F405)


345-345: Parameter adjustment for object_type=Perimeter.

Implementation follows the new perimeter model.

🧰 Tools
🪛 Ruff (0.8.2)

345-345: Perimeter may be undefined, or defined from star imports

(F405)


347-347: Looping over perimeter objects is valid.

No concerns here.

🧰 Tools
🪛 Ruff (0.8.2)

347-347: Perimeter may be undefined, or defined from star imports

(F405)


673-674: Filterset fields updated to perimeter-based attributes.

Looks correct as part of the refactor.


1557-1558: Filterset on risk_assessment__perimeter fields.

Shifting from project to perimeter is correct and consistent with the new data model.


1973-1973: Docstring updated to reflect domains and perimeters.

This statement clearly describes the new structure.


2611-2612: Same concern with .get() on _fields["perimeter"].

A missing or invalid perimeter ID would raise DoesNotExist.

🧰 Tools
🪛 Ruff (0.8.2)

2611-2611: Perimeter may be undefined, or defined from star imports

(F405)


3202-3202: Filterset update to perimeter aligns with the new architecture.

No issues here.


980-980: Handle .get() for Perimeter.objects.get(...) carefully.

This may raise an exception if the record is not found or if data["perimeter"] is missing. Consider adding error handling or a fallback.

 try:
-    perimeter=Perimeter.objects.get(id=data["perimeter"])
+    perimeter = Perimeter.objects.get(id=data["perimeter"])
 except Perimeter.DoesNotExist:
     return Response({"error": "Invalid perimeter ID"}, status=400)
🧰 Tools
🪛 Ruff (0.8.2)

980-980: Perimeter may be undefined, or defined from star imports

(F405)

frontend/src/routes/(app)/(internal)/x-rays/+page.server.ts (1)

6-6: Endpoint changed from projects to perimeters.

This is consistent with the perimeter-centric refactor.

backend/tprm/migrations/0004_remove_entityassessment_project_and_more.py (3)

1-2: Auto-generated migration header.

No issues. The migration comment is standard.


14-17: Removing the project field from EntityAssessment.

Eliminating the field aligns with the new perimeter model. Ensure any data referencing project is handled properly before migration.


18-27: Introducing a nullable foreign key to Perimeter.

This replacement is consistent with the shift from project to perimeter. Verify that existing references transition smoothly.

frontend/src/routes/(app)/(internal)/analytics/ComposerSelect.svelte (1)

21-21: LGTM! Change aligns with project → perimeter refactoring

The update to use 'perimeter' instead of 'project' in extra_fields is consistent with the broader refactoring effort.

backend/core/tests/fixtures.py (1)

4-4: LGTM! Test fixture properly updated for perimeter refactoring

The changes to the fixture are consistent with the model refactoring from Project to Perimeter.

Let's verify that all test files using this fixture have been updated:

Also applies to: 13-13, 20-21

✅ Verification successful

Refactoring verification complete - all test files properly updated

The codebase has been thoroughly checked and no remaining references to the old Project model or domain_project_fixture were found in any test files. The refactoring from Project to Perimeter appears to be complete and consistent.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining references to the old fixture name
rg "domain_project_fixture" -l

# Search for any remaining Project model references in test files
rg "from core\.models import .*Project" "backend/**/test*.py"
rg "Project\.objects\." "backend/**/test*.py"

Length of output: 262


Script:

#!/bin/bash
# Find test files and search for fixture references
fd "test.*\.py$" backend/ | xargs rg "domain_project_fixture" -l

# Search for Project model references in test files
fd "test.*\.py$" backend/ | xargs rg "from core\.models import .*Project" -A 2
fd "test.*\.py$" backend/ | xargs rg "Project\.objects\." -A 2

# Also check for any direct Project class usage
fd "test.*\.py$" backend/ | xargs rg "\bProject\b" -A 2

Length of output: 268


Script:

#!/bin/bash
# Check repository structure
ls -R

# Find all Python files to understand project structure
fd "\.py$"

# Find all test-related files regardless of extension
fd "test"

Length of output: 53085


Script:

#!/bin/bash
# Search for Project references in test files
rg -l "Project" backend/*/tests/ backend/app_tests/

# Search specifically for the old fixture name
rg -l "domain_project_fixture" backend/*/tests/ backend/app_tests/

# Check for any Project model imports in test files
rg "from core\.models import.*Project" backend/*/tests/ backend/app_tests/

# Look for Project usage in test files
rg "\bProject\." backend/*/tests/ backend/app_tests/

Length of output: 690

backend/core/migrations/0050_rename_project_perimeter_alter_perimeter_options_and_more.py (2)

15-18: LGTM! Model rename operation is correctly defined

The rename operation from Project to Perimeter is properly structured.


31-50: Consider data integrity implications of nullable perimeter field

The new perimeter foreign key fields are defined with null=True, which could lead to orphaned assessments. Consider if this is intentional or if assessments should always be associated with a perimeter.

Let's check if there are any existing assessments that might be affected:

frontend/src/lib/components/Forms/ModelForm/RiskScenarioForm.svelte (1)

43-43: LGTM! Change aligns with project → perimeter refactoring

The update to use 'perimeter' instead of 'project' in extra_fields is consistent with the broader refactoring effort.

frontend/src/lib/components/Forms/ModelForm/RiskAcceptanceForm.svelte (1)

62-62: Verify the impact on existing risk scenarios data.

The change from 'project' to 'perimeter' in extra_fields might affect how existing risk scenarios are displayed and filtered in the UI.

Run this script to check for any orphaned risk scenarios:

✅ Verification successful

The change from 'project' to 'perimeter' in extra_fields is safe

The modification is consistent with the codebase architecture where risk scenarios access perimeter data through their risk assessment relationship. This UI-only change doesn't affect existing data or functionality.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for risk scenarios that might be affected by the project->perimeter transition
ast-grep --pattern 'class RiskScenario {
  $$$
  project = $field
  $$$
}'

Length of output: 76


Script:

#!/bin/bash
# Find relevant files
echo "=== Files containing RiskScenario ==="
fd -t f -e py -e js -e svelte . | xargs rg -l "RiskScenario"

echo -e "\n=== Risk Scenario API endpoints ==="
rg -A 3 "risk.*scenario" -g "*.py"

echo -e "\n=== Project/Perimeter field usage ==="
rg "(project|perimeter).*(risk|scenario)" -g "*.{py,js,svelte}"

Length of output: 60165

backend/core/management/commands/status.py (1)

15-15: LGTM! Consistent renaming from projects to perimeters.

The changes maintain consistency with the perimeter-centric refactoring.

Also applies to: 41-41

🧰 Tools
🪛 Ruff (0.8.2)

15-15: Perimeter may be undefined, or defined from star imports

(F405)

backend/tprm/views.py (1)

31-31: Verify API backward compatibility for existing clients.

The change in filter fields from 'project' to 'perimeter' might break existing API clients that use these filters.

Run this script to check for API usage patterns:

✅ Verification successful

API change is properly handled through migrations

The change from 'project' to 'perimeter' is part of a planned database schema migration (migration 0050). No direct usage of these filter fields was found in frontend code, and the change is properly handled through Django's migration system, ensuring database consistency.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search for API calls using project filters
rg -l 'project(?:__folder)?' --type js --type py

Length of output: 1054


Script:

#!/bin/bash
# Check when TPRM feature was introduced and the timeline of changes
git log --oneline -- backend/tprm/

Length of output: 0

frontend/src/routes/(app)/(internal)/risk-assessments/[id=uuid]/remediation-plan/+page.svelte (1)

50-50: LGTM! Perimeter references are correctly updated.

The changes consistently replace project references with perimeter in both the display text and URL structure.

Let's verify that all project references have been replaced in this component:

Also applies to: 53-54

✅ Verification successful

All perimeter references are correctly updated, no project references remain

The file shows consistent use of "perimeter" terminology in all relevant places - translation keys, URL paths, and data structures. No instances of "project" were found in the component.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining "project" references in the file
rg -i "project" "frontend/src/routes/(app)/(internal)/risk-assessments/[id=uuid]/remediation-plan/+page.svelte"

Length of output: 111


Script:

#!/bin/bash
# First verify file exists
fd "page.svelte" frontend/src/routes/

# If file exists, show its content
cat frontend/src/routes/\(app\)/\(internal\)/risk-assessments/\[id=uuid\]/remediation-plan/+page.svelte

# Search for any files that might contain related code
fd "remediation-plan" frontend/src/

Length of output: 8377

frontend/src/lib/utils/types.ts (2)

32-32: LGTM! URL model updated correctly.

The URL_MODEL array now includes 'perimeters' instead of 'projects', maintaining consistency with the API endpoints.


Line range hint 105-115: Verify interface usage across the codebase.

The Project interface has been renamed to Perimeter while maintaining the same structure. We should verify that all references to this interface have been updated.

Let's check for any remaining references to the Project interface:

✅ Verification successful

All references to the Project interface have been successfully updated

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for Project interface references in TypeScript files
rg -t ts "interface Project" 
# Search for type references to Project
rg -t ts "Project[^a-zA-Z]"

Length of output: 60


Script:

#!/bin/bash
# Search with various patterns that might reference the Project interface
rg -i "project" --type ts --type js -A 2 -B 2
rg ": Project" --type ts -A 2 -B 2
rg "as Project" --type ts -A 2 -B 2
rg "<Project>" --type ts -A 2 -B 2
rg "@type.*Project" --type js --type ts -A 2 -B 2

Length of output: 1422

frontend/src/lib/components/Forms/ModelForm/RiskAssessmentForm.svelte (1)

33-40: LGTM! Form component updated consistently.

The AutocompleteSelect component has been properly updated to use perimeter instead of project throughout all its properties:

  • Foreign key reference
  • Field name
  • Cache references
  • Label
  • Hidden condition

Let's verify that all project references have been updated in this form:

✅ Verification successful

All "project" references successfully replaced with "perimeter"

The verification confirms that all references have been properly updated in the RiskAssessmentForm component, and no other forms in the directory contain legacy "project" references.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining "project" references in the form
rg -i "project" "frontend/src/lib/components/Forms/ModelForm/RiskAssessmentForm.svelte"
# Check if similar forms have been updated consistently
fd -t f ".*Form.svelte" "frontend/src/lib/components/Forms/ModelForm/" -x rg -l "project"

Length of output: 173


Script:

#!/bin/bash
# Verify file existence and path
fd "RiskAssessmentForm.svelte" frontend/

# Search for both project and perimeter with context
echo "=== Searching for 'project' references ==="
rg -i "project" frontend/src/lib/components/Forms/ModelForm/RiskAssessmentForm.svelte -C 2

echo "=== Searching for 'perimeter' references ==="
rg -i "perimeter" frontend/src/lib/components/Forms/ModelForm/RiskAssessmentForm.svelte -C 2

# Find similar forms
echo "=== Finding similar forms with 'project' references ==="
fd -t f "Form.svelte$" frontend/src/lib/components/Forms/ModelForm/ -x rg -l "project"

Length of output: 1001

frontend/tests/functional/detailed/common.test.ts (1)

14-14: LGTM! Parameter and usage updated consistently.

The refactoring from project to perimeter has been applied consistently in both the function signature and its usage.

Also applies to: 27-27

backend/iam/tests/test_user.py (2)

12-12: LGTM! Reader role permissions updated correctly.

The fixture and view permission have been correctly updated from project to perimeter.

Also applies to: 21-21


50-50: LGTM! Editor role permissions updated comprehensively.

All project-related permissions (view, add, change, delete) have been consistently updated to use perimeter.

Also applies to: 59-59, 69-71

frontend/src/routes/(app)/(internal)/recap/+page.svelte (2)

24-24: LGTM! Template and routing updated consistently.

The changes from projects to perimeters have been applied consistently across:

  • Data iteration (data.perimeters)
  • Conditional checks (perimeter.compliance_assessments)
  • URL construction (/perimeters/{perimeter.id})

Also applies to: 26-26, 32-32


37-37: Verify data structure compatibility.

Ensure that the overallCompliance and compliance_assessments properties maintain the same structure in the perimeter model as they had in the project model.

Also applies to: 49-49

✅ Verification successful

Data structure compatibility verified successfully

The overallCompliance and compliance_assessments properties maintain consistent structure between perimeter and project models, with proper typing in the frontend and matching backend implementation. The sorting and display logic in the component correctly handles the data structure.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for type definitions and model structures
rg -A 5 "interface.*Perimeter" frontend/src/
rg -A 5 "class.*Perimeter.*Model" backend/core/models.py

Length of output: 1445


Script:

#!/bin/bash
# Search for RequirementAssessmentDonutItem and compliance types/models
rg -A 5 "type.*RequirementAssessmentDonutItem|interface.*RequirementAssessmentDonutItem" frontend/src/
rg -A 10 "class.*ComplianceAssessment|compliance_assessments" backend/core/models.py
rg -A 5 "overallCompliance.*values" frontend/src/

Length of output: 6003

backend/core/tests/test_helpers.py (2)

41-44: LGTM! Test cases updated correctly.

The test setup has been properly updated to use Perimeter instead of Project.

Also applies to: 51-51

🧰 Tools
🪛 Ruff (0.8.2)

41-41: Perimeter may be undefined, or defined from star imports

(F405)


42-42: RiskAssessment may be undefined, or defined from star imports

(F405)


106-109: LGTM! Duplicate test case updated consistently.

The second test case has been updated consistently with the same project to perimeter changes.

Also applies to: 116-116

🧰 Tools
🪛 Ruff (0.8.2)

106-106: Perimeter may be undefined, or defined from star imports

(F405)


107-107: RiskAssessment may be undefined, or defined from star imports

(F405)

backend/core/tests/test_vulnerability.py (1)

19-19: LGTM! Consistent fixture renaming.

The changes correctly reflect the transition from projects to perimeters in the test fixtures and method signatures.

Let's verify that all project references have been updated consistently:

Also applies to: 37-37, 54-54, 84-84

✅ Verification successful

Fixture renaming verification successful

The transition from projects to perimeters is complete and consistent across all test files. No legacy "project" references remain in the codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining references to 'project' in test files
rg -i "project" "backend/core/tests/" --type py

Length of output: 45


Script:

#!/bin/bash
# First, verify the directory structure and Python files
echo "=== Checking directory structure ==="
ls -la backend/core/tests/

echo -e "\n=== Listing Python files ==="
fd -e py . backend/core/tests/

echo -e "\n=== Searching for project/perimeter references ==="
rg -i "project|perimeter" backend/core/tests/ --type py -C 2

echo -e "\n=== AST-based search for function parameters and variables ==="
ast-grep --pattern 'def $_(project$_)' backend/core/tests/
ast-grep --pattern 'def $_(perimeter$_)' backend/core/tests/

Length of output: 32453

frontend/src/routes/(app)/(internal)/analytics/+page.server.ts (1)

6-6: LGTM! Type definitions updated correctly.

The changes maintain type safety while transitioning from projects to perimeters.

Let's verify type consistency across the frontend:

Also applies to: 31-31

✅ Verification successful

Type consistency verified: Project to Perimeter migration is complete

The codebase shows consistent usage of the Perimeter type with no remaining references to the old Project type. The type system is properly maintained across the frontend.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining Project type references
rg -l "type.*Project.*" "frontend/src/" --type ts

Length of output: 49


Script:

#!/bin/bash
# More comprehensive search for Project-related types
ast-grep --pattern 'type Project = {
  $$$
}'

ast-grep --pattern 'interface Project {
  $$$
}'

# Search for Perimeter type usage
rg "Perimeter" "frontend/src/" --type ts -A 2

# Broader search for any remaining "Project" string
rg "Project" "frontend/src/" --type ts

Length of output: 2873

frontend/src/lib/components/SideBar/SideBar.svelte (1)

62-64: LGTM! Tour steps updated consistently.

The guided tour steps have been updated to reflect the new perimeter terminology, maintaining a consistent user experience.

Let's verify the message translations exist:

Also applies to: 71-71

✅ Verification successful

Translation keys are properly defined and implemented

The tourPerimetersDescription translation key is correctly defined in both English and French language files, with proper formatting and consistent terminology.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for the new translation keys
rg "tourPerimeters.*" "frontend/src/lib/i18n/" --type ts

Length of output: 119


Script:

#!/bin/bash
# Find i18n-related files and directories
fd -t d "i18n"

Length of output: 14


Script:

#!/bin/bash
# Search for the translation method call pattern
rg "tourPerimetersDescription"

Length of output: 478

frontend/src/routes/(app)/(internal)/recap/+page.server.ts (2)

3-3: LGTM! Type definitions updated correctly.

The type imports and interface definitions have been updated to reflect the new perimeter model.

Also applies to: 27-27


35-39: Verify error handling for API responses.

While the API endpoint updates look correct, ensure proper error handling for failed requests.

Let's verify the API endpoint exists:

Also applies to: 42-42

✅ Verification successful

Error handling is properly implemented

The code has appropriate error handling:

  • Backend uses Django REST Framework's ModelViewSet with built-in error handling
  • Frontend implements .catch() with proper fallback to empty array and error logging
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for the perimeters API endpoint definition
rg -A 5 "class.*PerimeterViewSet" "backend/" --type py

Length of output: 331


Script:

#!/bin/bash
# Check BaseModelViewSet implementation
rg -A 10 "class BaseModelViewSet" "backend/" --type py

# Check for error handling patterns around fetch calls in frontend
rg -B 2 -A 2 "catch\(" "frontend/src/routes/(app)/(internal)/recap/"

Length of output: 2796

backend/serdes/tests/test_dump.py (1)

23-23: LGTM!

The model type change from "project" to "perimeter" in the test fixture aligns with the broader refactoring effort.

frontend/src/lib/components/Forms/ModelForm/ComplianceAssessmentForm.svelte (1)

56-63: LGTM!

The AutocompleteSelect component has been correctly updated to use the perimeter model, maintaining all necessary properties and the extra_fields parameter.

backend/core/base_models.py (1)

80-81: LGTM!

The get_scope method has been correctly updated to check for the perimeter attribute instead of project, maintaining the existing scope filtering behavior.

backend/core/urls.py (1)

26-26: LGTM!

The URL pattern has been correctly updated to use the new perimeter endpoint.

🧰 Tools
🪛 Ruff (0.8.2)

26-26: PerimeterViewSet may be undefined, or defined from star imports

(F405)

frontend/src/lib/components/SideBar/navData.ts (1)

22-22: LGTM! Consistent terminology changes.

The changes correctly update all references from 'project' to 'perimeter' in both permissions and navigation items.

Also applies to: 34-34, 53-53, 55-55

frontend/src/lib/components/Forms/ModelForm/EntityAssessmentForm.svelte (1)

23-28: LGTM! Form properties correctly updated.

The AutocompleteSelect component's properties have been consistently updated from project to perimeter.

enterprise/frontend/src/lib/components/SideBar/navData.ts (1)

11-11: LGTM! Enterprise version changes align with community version.

All project-to-perimeter updates are consistent across both versions of navData.ts.

Also applies to: 23-23, 40-40, 52-52, 64-64, 83-83, 85-85

frontend/tests/utils/page-detail.ts (1)

44-44: LGTM! Test logic updated for perimeter model.

The verifyItem method correctly handles the new perimeter-based model.

Consider running the following to verify test coverage:

Also applies to: 47-47

✅ Verification successful

Verified: Changes are well-covered by existing test suite

The perimeter model is already well-tested across multiple test files:

  • Utility tests: test-data.ts, test-utils.ts
  • Functional tests: user-route.test.ts, common.test.ts, compliance-assessments.test.ts

The 'project' reference in e2e-tests.sh is unrelated as it's only used for Playwright configuration.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check test coverage for perimeter-related changes

# Search for test files that might need updates
rg -l 'project' frontend/tests/

Length of output: 59


Script:

#!/bin/bash
# Check context of 'project' usage and search for perimeter tests
echo "=== Project usage in e2e-tests.sh ==="
rg -C 3 'project' frontend/tests/e2e-tests.sh

echo -e "\n=== Existing perimeter test coverage ==="
rg -l 'perimeter' frontend/tests/

echo -e "\n=== Test file patterns ==="
fd -e ts -e js -e jsx -e tsx . frontend/tests/

Length of output: 2560

frontend/src/routes/(app)/(internal)/analytics/composer/+page.svelte (1)

127-127: LGTM! Property access updated correctly.

The change from project.str to perimeter.str aligns with the codebase refactoring from project to perimeter model.

backend/app_tests/api/test_api_perimeters.py (2)

21-75: LGTM! Comprehensive test coverage for unauthenticated scenarios.

The test class properly covers all CRUD operations for unauthenticated access:

  • GET perimeters
  • CREATE perimeters
  • UPDATE perimeters
  • DELETE perimeters

82-173: LGTM! Well-structured authenticated test cases with proper validation.

The test class thoroughly covers:

  • CRUD operations with authentication
  • Status choices validation
  • Response structure verification
  • Proper folder relationships
frontend/src/routes/(app)/(internal)/[model=urlmodel]/[id=uuid]/+page.server.ts (1)

76-76: LGTM! Model check updated correctly.

The condition update from 'projects' to 'perimeters' maintains the same redirect logic while aligning with the new model terminology.

frontend/tests/functional/detailed/compliance-assessments.test.ts (1)

14-14: LGTM! Test requirements updated correctly.

The test requirements array has been updated to use 'perimeters' instead of 'projects', maintaining consistency with the model refactoring while preserving the test's functionality.

frontend/tests/utils/test-data.ts (1)

6-6: LGTM! Consistent renaming from project to perimeter.

The changes systematically replace project-related keys and permissions with perimeter-related ones across all user roles, maintaining the same access control structure.

Let's verify that no project-related permissions remain:

Also applies to: 34-34, 47-47, 63-63, 81-81, 112-112, 141-141, 156-156, 174-174, 193-193, 214-214

✅ Verification successful

Verification successful: Project to perimeter migration is complete and consistent

The test data shows all permissions have been properly migrated from project to perimeter across all user roles (analyst, reader, domainManager, approver). No legacy project permissions remain in the codebase. The only project references found are unrelated to the permission system (Playwright test configuration).

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search for any remaining project-related permissions.

# Test: Search for any remaining project-related permissions. Expect: No matches.
rg -i 'project' | rg -i 'perm'

Length of output: 131070


Script:

#!/bin/bash
# Search for permission-related files and check project/perimeter references

# Find permission-related files
echo "=== Permission files ==="
fd -e ts -e js perm

# Check for project references in those files
echo -e "\n=== Project references in permission files ==="
fd -e ts -e js perm --exec rg -i project {} || true

# Check for perimeter references in permission files
echo -e "\n=== Perimeter references in permission files ==="
fd -e ts -e js perm --exec rg -i perimeter {} || true

Length of output: 465


Script:

#!/bin/bash
# Examine test data and related files

# View test data file content
echo "=== Test data file content ==="
cat frontend/tests/utils/test-data.ts || true

# Look for permission-related types/interfaces
echo -e "\n=== Permission types and interfaces ==="
rg -t typescript "type.*Permission|interface.*Permission" frontend/

# Check for any remaining project references in frontend tests
echo -e "\n=== Project references in frontend tests ==="
rg -i project frontend/tests/

Length of output: 8592

frontend/tests/functional/user-route.test.ts (3)

128-128: LGTM! Correct perimeter reference in compliance assessment.

The path format ${folderName}/${perimeterName} is correctly structured for the perimeter reference.


183-183: LGTM! Correct perimeter reference in risk assessment.

The path format ${folderName}/${perimeterName} is correctly structured for the perimeter reference.


217-217: LGTM! Correct perimeter references in risk scenario and acceptance paths.

The path formats correctly include the perimeter in the hierarchical structure:

  • Risk scenario: ${folderName}/${perimeterName}/${riskAssessmentName} - ${riskAssessmentVersion}
  • Risk acceptance: ${folderName}/${perimeterName}/${riskAssessmentName} - ${riskAssessmentVersion}/${riskScenarioName}

Also applies to: 236-236

frontend/src/routes/(app)/(internal)/risk-scenarios/[id=uuid]/edit/+page.server.ts (1)

139-139: LGTM! Correct folder reference from perimeter.

The path to get the folder ID has been correctly updated to use the perimeter object.

Let's verify the perimeter object structure:

✅ Verification successful

✓ Verified: perimeter.folder.id is correctly structured and consistently used

The change is valid as the Perimeter interface properly defines the folder property, and this structure is consistently used across both frontend and backend codebases.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the perimeter object structure in the codebase.

# Test: Search for perimeter folder references. Expect: Consistent usage of perimeter.folder.id.
ast-grep --pattern 'perimeter.folder.id'

Length of output: 724


Script:

#!/bin/bash
# Search for perimeter type definitions and implementations

# Look for type definitions of perimeter
ast-grep --pattern 'type Perimeter = {
  $$$
}'

# Look for interface definitions
ast-grep --pattern 'interface Perimeter {
  $$$
}'

# Search for actual implementations using perimeter.folder
rg "perimeter\.folder" -t ts -t py

Length of output: 3388

frontend/src/routes/(app)/(internal)/risk-assessments/[id=uuid]/+page.svelte (1)

112-112: LGTM! Correct string reference from perimeter.

The path to get the string representation has been correctly updated to use the perimeter object, maintaining the hierarchical display format: {perimeter.str}/{name} - {version}.

Let's verify the string representation format:

✅ Verification successful

Verified: Perimeter string representation is correctly used

The change from project.str to perimeter.str is correct and consistent with the codebase's standardized format for perimeter string representation (folder.name/perimeter.name). The hierarchical display format {perimeter.str}/{name} - {version} is maintained across the application.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the perimeter string representation format in the codebase.

# Test: Search for perimeter string references. Expect: Consistent usage of perimeter.str.
ast-grep --pattern 'perimeter.str'

Length of output: 34


Script:

#!/bin/bash
# Search for perimeter references and string representations

# Look for perimeter references in various contexts
rg "perimeter\." -A 2 -B 2

# Search for risk assessment type definitions or interfaces
rg "interface.*RiskAssessment|type.*RiskAssessment|class.*RiskAssessment" -A 5 -B 1

# Look for string representation patterns
rg "\.str\b" -A 1 -B 1

Length of output: 67384

backend/tprm/serializers.py (2)

56-56: LGTM: Field replacement looks correct.

The project field has been correctly replaced with a perimeter field using FieldsRelatedField.


98-98: LGTM: Audit creation logic updated correctly.

The audit creation logic has been properly updated to use the perimeter model:

  • Uses perimeter for audit creation
  • Correctly constructs the enclave folder name using perimeter.name

Also applies to: 106-106

backend/app_tests/api/test_api_risk_acceptances.py (2)

5-5: LGTM: Import statement updated correctly.

The Project model import has been properly replaced with Perimeter.


142-142: LGTM: Test data creation updated correctly.

The test data creation has been properly updated to use Perimeter instances instead of Project instances in both test methods.

Also applies to: 194-194

backend/app_tests/api/test_api_risk_assessments.py (4)

3-3: LGTM: Imports and comments updated correctly.

The Project model import and related comments have been properly replaced with Perimeter.

Also applies to: 8-8


30-32: LGTM: Unauthenticated test cases updated correctly.

All unauthenticated test cases have been properly updated to use Perimeter instances instead of Project instances.

Also applies to: 49-51, 65-67, 90-92


108-108: LGTM: Authenticated test cases updated correctly.

All authenticated test cases have been properly updated:

  • Test data creation uses Perimeter
  • Response validation checks for perimeter fields
  • Object relationships properly maintained

Also applies to: 119-128, 141-141, 152-152, 156-161, 175-177, 190-190, 197-197, 201-206, 219-219, 228-228


239-239: LGTM: Status choice test updated correctly.

The TODO comment has been updated to reference Perimeter.PRJ_LC_STATUS instead of Project.PRJ_LC_STATUS.

frontend/src/routes/(app)/(internal)/risk-scenarios/[id=uuid]/+page.svelte (1)

89-92: LGTM: UI updated correctly for perimeter display.

The component has been properly updated to display perimeter information:

  • Uses correct translation key for perimeter label
  • Links to the correct perimeter detail route
  • Displays perimeter data consistently
frontend/src/routes/(app)/(internal)/x-rays/+page.svelte (4)

Line range hint 26-40: LGTM!

The variable name and data mapping logic correctly align with the perimeter-based structure.


44-47: LGTM!

The conditional check correctly uses the renamed variable.


47-56: LGTM!

The iteration, URL path, and display string correctly use the perimeter-based structure.


Line range hint 59-280: LGTM!

The template consistently uses the perimeter-based structure throughout the tab groups and conditional checks.

backend/app_tests/api/test_api_compliance_assessments.py (5)

4-4: LGTM!

The import statement correctly reflects the model change from Project to Perimeter.


32-34: LGTM!

The test correctly creates a Perimeter instance for the compliance assessment.


49-52: LGTM!

The test correctly creates a Perimeter instance for creating compliance assessments.


66-76: LGTM!

The test correctly creates two Perimeter instances for updating compliance assessments.


90-93: LGTM!

The test correctly creates a Perimeter instance for deleting compliance assessments.

frontend/src/routes/(app)/(internal)/risk-scenarios/[id=uuid]/edit/+page.svelte (1)

95-99: LGTM!

The text label, URL path, and display string correctly reflect the transition to perimeter-based structure.

backend/ebios_rm/serializers.py (1)

30-30: LGTM!

The serializer field correctly uses the perimeter-based structure while maintaining the same field configuration.

frontend/src/lib/components/Forms/ModelForm.svelte (2)

9-9: LGTM! Import statement updated to reflect the new perimeter-centric architecture.

The import statement has been correctly updated from ProjectForm to PerimeterForm as part of the project → perimeter refactoring.


190-191: LGTM! Conditional rendering updated to use perimeter terminology.

The condition has been correctly updated to check for 'perimeters' instead of 'projects', maintaining consistency with the new architecture.

backend/app_tests/api/test_api_requirement_assessments.py (2)

10-10: LGTM! Import statement updated for the new model.

The import statement has been correctly updated to use Perimeter instead of Project.


42-42: LGTM! Test cases updated to use Perimeter model.

All test cases have been consistently updated to create and use Perimeter objects instead of Project objects, maintaining test coverage while adapting to the new architecture.

Also applies to: 80-80, 105-105, 180-180, 216-216, 221-221

backend/core/filters.py (4)

18-18: LGTM! Import statement updated for the new model.

The import statement has been correctly updated to use Perimeter instead of Project.


Line range hint 151-177: LGTM! Domain filter class renamed to reflect new terminology.

The ProjectsDomainFilter class has been correctly renamed to PerimetersDomainFilter while maintaining its functionality.


Line range hint 178-203: LGTM! Filter class renamed and placeholder text updated.

The ProjectFilter class has been correctly renamed to PerimeterFilter with appropriate updates to the placeholder text.


362-362: LGTM! Field renamed in ComplianceAssessmentFilter.

The field has been correctly renamed from project to perimeter in the ComplianceAssessmentFilter class.

frontend/src/lib/components/DetailView/DetailView.svelte (2)

179-181: LGTM! Condition updated to use perimeter terminology.

The condition has been correctly updated to check for 'perimeters' instead of 'projects', maintaining the same related models array.


186-186: LGTM! Related models array updated for folders.

The related models array for folders has been correctly updated to use 'perimeters' instead of 'projects'.

frontend/src/routes/(app)/(third-party)/compliance-assessments/[id=uuid]/+page.svelte (1)

235-235: LGTM! Filter list updated correctly.

The filter list has been updated to use 'perimeter' instead of 'project', maintaining consistency with the broader refactoring effort.

cli/clica.py (1)

162-164: LGTM! CLI commands and parameters updated consistently.

The CLI tool has been updated to use 'perimeter' terminology instead of 'project', with consistent changes across function names, parameters, variables, and dictionary keys.

Also applies to: 208-208, 218-218, 225-225, 232-232

frontend/src/routes/(app)/(internal)/analytics/+page.svelte (1)

331-334: LGTM! Analytics counter updated consistently.

The CounterCard component has been updated to use 'perimeter' terminology instead of 'project', with consistent changes to the count property, label, and navigation href.

backend/serdes/utils.py (1)

19-19: LGTM! Serialization utilities updated consistently.

The serialization utilities have been updated to use 'perimeter' terminology instead of 'project', with consistent changes across imports, serializer mappings, queries, and dictionary keys.

Also applies to: 48-48, 212-212, 432-432, 435-435, 466-466, 548-548

backend/app_tests/api/test_api_risk_scenarios.py (1)

16-16: LGTM! Comment updated to reflect new terminology.

The comment has been correctly updated from "Generic project data" to "Generic perimeter data" to maintain consistency with the new model.

backend/core/startup.py (1)

24-24: Verify permission migration completeness.

The project-to-perimeter permission migration has been applied across all role permission lists:

  • READER_PERMISSIONS_LIST
  • APPROVER_PERMISSIONS_LIST
  • ANALYST_PERMISSIONS_LIST
  • DOMAIN_MANAGER_PERMISSIONS_LIST
  • ADMINISTRATOR_PERMISSIONS_LIST

Let's verify that no permissions were missed and the hierarchy is maintained:

Also applies to: 53-53, 96-96, 110-110, 127-127, 146-146, 206-206, 221-221, 239-239, 262-262, 343-346

✅ Verification successful

Permission migration successfully verified

The project-to-perimeter permission migration has been completed correctly across all role permission lists. The permission hierarchy is properly maintained, and no legacy project permissions remain in the active codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify permission migration completeness

# Check for any remaining 'project' permissions
echo "Checking for any remaining project permissions..."
rg -i 'project' backend/core/migrations/

# Verify permission hierarchy in migrations
echo "Checking permission hierarchy in migrations..."
rg -A 5 'permission_classes' backend/core/

Length of output: 5569


Script:

#!/bin/bash
# Check permission lists in startup.py
echo "Checking permission lists in startup.py..."
cat backend/core/startup.py

# Search for any remaining project permissions in non-migration files
echo -e "\nChecking for remaining project permissions in core..."
rg -i "project.*permission" backend/core/ --type py -g '!migrations/*'

Length of output: 18202

frontend/src/lib/utils/schemas.ts (2)

Line range hint 78-83: LGTM! PerimeterSchema correctly defined.

The schema has been properly renamed and structured with appropriate fields:

  • name and description from NameDescriptionMixin
  • folder as required string
  • ref_id as optional nullable string
  • lc_status with default value

99-99: Verify schema references are updated consistently.

The project to perimeter field updates have been made in:

  • RiskAssessmentSchema
  • ComplianceAssessmentSchema
  • EntityAssessmentSchema
  • SCHEMA_MAP

Let's verify all references are updated:

Also applies to: 271-271, 362-362, 494-494

✅ Verification successful

Schema references are updated consistently

The migration from 'project' to 'perimeter' is complete and consistent across all schemas and their usages in the codebase. No remaining references to 'project' were found that need updating.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify schema reference updates

# Check for any remaining 'project' references in schema files
echo "Checking for remaining project references in schemas..."
rg -i 'project' frontend/src/lib/utils/

# Check for any missed schema updates
echo "Checking for any missed schema updates..."
rg -A 3 'Schema.*=.*z\.object' frontend/src/lib/utils/

Length of output: 10448


Script:

#!/bin/bash
# Search for SCHEMA_MAP and any remaining project/perimeter references
echo "Searching for SCHEMA_MAP..."
rg "SCHEMA_MAP" frontend/src/

echo "Checking for project/perimeter references in frontend..."
rg -i "project|perimeter" frontend/src/

Length of output: 17290

frontend/tests/utils/test-utils.ts (2)

24-24: LGTM! Test fixtures updated correctly.

The perimetersPage fixture has been properly added to replace projectsPage in:

  • Fixtures type definition
  • pages object construction
  • page usage

Also applies to: 62-62, 81-81


Line range hint 371-379: Verify test data generation and page content.

The test content has been updated to use perimeter instead of project in:

  • itemBuilder perimetersPage section
  • complianceAssessmentsPage build
  • riskAssessmentsPage build
  • riskScenariosPage build
  • riskAcceptancesPage build

Let's verify the test coverage:

Also applies to: 484-484, 528-528, 550-550, 577-577

✅ Verification successful

All test data sections properly updated to use perimeter instead of project

The verification confirms that all mentioned sections in test-utils.ts have been correctly updated to use perimeter-related fields and paths:

  • perimetersPage build section
  • complianceAssessmentsPage perimeter field
  • riskAssessmentsPage perimeter field
  • riskScenariosPage risk_assessment path
  • riskAcceptancesPage risk_scenarios path
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify test data and page content updates

# Check for any remaining 'project' references in test files
echo "Checking for remaining project references in tests..."
rg -i 'project' frontend/tests/

# Check test patterns for perimeter-related functionality
echo "Checking test patterns for perimeter functionality..."
rg -A 3 'test.*perimeter' frontend/tests/

Length of output: 2257


Script:

#!/bin/bash
# Check the test data structure in the mentioned sections
echo "Checking test data structure..."
rg -A 10 'perimetersPage.*build' frontend/tests/
rg -A 10 'complianceAssessmentsPage.*build' frontend/tests/
rg -A 10 'riskAssessmentsPage.*build' frontend/tests/
rg -A 10 'riskScenariosPage.*build' frontend/tests/
rg -A 10 'riskAcceptancesPage.*build' frontend/tests/

Length of output: 1424


Script:

#!/bin/bash
# Examine test-utils.ts directly
echo "Checking test-utils.ts content..."
cat frontend/tests/utils/test-utils.ts

# Also check for any related test data definitions
echo -e "\nChecking for related test data definitions..."
rg -l "testObjectsData" frontend/tests/

Length of output: 18981

frontend/src/lib/utils/table.ts (3)

Line range hint 31-81: LGTM! Filter constants have been correctly renamed.

The renaming of filter constants from PROJECT to PERIMETER is consistent with the refactoring objective while maintaining the same functionality.


386-391: LGTM! List view fields configuration updated correctly.

The renaming of the 'projects' key to 'perimeters' in listViewFields maintains the same configuration structure while aligning with the new terminology.


433-437: LGTM! Assessment configurations updated consistently.

References to project have been correctly updated to perimeter in both risk and compliance assessment configurations.

Also applies to: 623-627

backend/iam/models.py (1)

161-167: LGTM! Path navigation updated correctly.

The path navigation in the get_folder method has been properly updated to use 'perimeter' instead of 'project' while maintaining the same traversal logic.

Let's verify the path navigation changes with a test:

✅ Verification successful

Path navigation changes verified successfully

The only remaining references to project.folder are in migration files which is expected and correct, as they document the historical transition. All active folder path navigation now uses 'perimeter' consistently.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that all folder path navigations have been updated from project to perimeter

# Test: Search for any remaining references to 'project' in folder path navigation
rg -i 'project.*folder' -g '!*.md' -g '!*.po'

# Test: Verify the new perimeter folder path navigation exists
rg -i 'perimeter.*folder' -g '!*.md' -g '!*.po'

Length of output: 65939

frontend/src/routes/(app)/(internal)/compliance-assessments/[id=uuid]/action-plan/+page.svelte (1)

43-47: LGTM! UI references updated correctly.

The component has been properly updated to use perimeter instead of project in messages, URLs, and data references while maintaining the same UI functionality.

backend/core/templates/snippets/ra_data.html (1)

10-10: LGTM! Project to perimeter model refactoring.

The template has been correctly updated to reference the perimeter model instead of project.

backend/core/templates/core/action_plan_pdf.html (1)

14-14: LGTM! Project to perimeter model refactoring.

The template has been correctly updated to:

  1. Reference the perimeter model instead of project
  2. Update the display labels from "Project" to "Perimeter"

Also applies to: 16-16

backend/core/templates/snippets/mp_data.html (1)

7-7: LGTM! Project to perimeter model refactoring.

The template has been correctly updated to:

  1. Reference the perimeter model instead of project
  2. Update the display labels from "Project" to "Perimeter"

Also applies to: 9-9

frontend/messages/ur.json (1)

28-28: LGTM! Keys updated while preserving user-friendly translations.

The changes consistently replace "project" with "perimeter" in the keys while retaining the familiar term "پروجیکٹ" (project) in the translations. This approach maintains a good user experience during the backend architectural transition.

Also applies to: 41-41, 81-81, 119-119, 187-187, 189-189, 224-224

frontend/messages/cs.json (1)

26-26: LGTM! Consistent key updates while maintaining user-friendly translations.

The changes systematically replace "project" with "perimeter" in the keys while preserving the familiar term "projekt" in the translations. This approach:

  1. Aligns with the backend architectural changes
  2. Maintains consistency with other language files
  3. Ensures a smooth user experience during the transition

Also applies to: 39-39, 79-79, 117-117, 185-185, 187-187, 222-222

frontend/messages/pl.json (1)

28-28: LGTM! Keys renamed consistently while preserving user-facing terminology.

The changes in the Polish translation file correctly rename all project-related keys to use "perimeter" while maintaining "projekt" in the displayed text, ensuring a consistent internal architecture change without impacting the user experience.

Also applies to: 41-41, 81-81, 119-119, 187-187, 189-189, 224-224

frontend/messages/ro.json (1)

28-28: LGTM! Keys renamed consistently while preserving user-facing terminology.

The changes in the Romanian translation file correctly rename all project-related keys to use "perimeter" while maintaining "proiect" in the displayed text, ensuring a consistent internal architecture change without impacting the user experience.

Also applies to: 41-41, 81-81, 119-119, 187-187, 189-189, 224-224

frontend/messages/pt.json (1)

28-28: LGTM! Keys renamed consistently while preserving user-facing terminology.

The changes in the Portuguese translation file correctly rename all project-related keys to use "perimeter" while maintaining "projeto" in the displayed text, ensuring a consistent internal architecture change without impacting the user experience.

Also applies to: 41-41, 81-81, 119-119, 187-187, 189-189, 224-224

frontend/messages/it.json (1)

28-28: Verify if keeping "project" in display text is intentional.

The keys have been renamed from "project" to "perimeter" but the displayed text still shows "progetto" (project). For example:

  • addPerimeter: "Aggiungi progetto"
  • associatedPerimeters: "Progetti associati"
  • perimeters: "Progetti"
  • perimeter: "Progetto"
  • myPerimeters: "I miei progetti"
  • assignedPerimeters: "Assegnato al progetto{i} {number}"
  • perimetersSummaryEmpty: "Riepilogo del progetto"

Is this intentional to keep the UI showing "projects" while refactoring the backend?

Also applies to: 41-41, 81-81, 119-119, 187-187, 189-189, 224-224

✅ Verification successful

Keeping "project" in display text is intentional

This appears to be a deliberate choice to maintain user-friendly terminology in the UI ("progetto") while using more technically precise terms ("perimeter") in the codebase. This pattern is consistently applied across all Italian translations, suggesting it's an intentional decision to preserve a familiar user experience.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if this pattern is consistent across the codebase

# Check for any remaining "project" references in code
echo "Checking for remaining 'project' references..."
rg -i "project" --type ts --type js --type py

# Check for new "perimeter" terminology
echo "Checking for new 'perimeter' terminology..."
rg -i "perimeter" --type ts --type js --type py

Length of output: 56460

frontend/messages/es.json (1)

28-28: Same inconsistency found in Spanish translations.

The keys have been renamed but the displayed text still shows "proyecto" (project). For example:

  • addPerimeter: "Agregar proyecto"
  • associatedPerimeters: "Proyectos asociados"
  • perimeters: "Proyectos"
  • perimeter: "Proyecto"
  • myPerimeters: "Mis proyectos"
  • assignedPerimeters: "Asignado a {number} proyecto{s}"
  • perimetersSummaryEmpty: "Resumen de proyectos vacío"

Also applies to: 41-41, 81-81, 119-119, 187-187, 189-189, 224-224

frontend/messages/de.json (1)

28-28: Same inconsistency found in German translations.

The keys have been renamed but the displayed text still shows "Projekt" (project). For example:

  • addPerimeter: "Projekt hinzufügen"
  • associatedPerimeters: "Zugehörige Projekte"
  • perimeters: "Projekte"
  • perimeter: "Projekt"
  • myPerimeters: "Meine Projekte"
  • assignedPerimeters: "Zugewiesen zu {number} Projekt{en}"
  • perimetersSummaryEmpty: "Projektzusammenfassung ist leer"

Also applies to: 41-41, 81-81, 119-119, 187-187, 189-189, 224-224

frontend/messages/id.json (8)

29-29: LGTM! Key renamed while preserving the translation.

The key has been updated from addProject to addPerimeter while correctly maintaining the Indonesian translation "Tambahkan proyek".


42-42: LGTM! Key renamed while preserving the translation.

The key has been updated from associatedProjects to associatedPerimeters while correctly maintaining the Indonesian translation "Proyek terkait".


84-84: LGTM! Key renamed while preserving the translation.

The key has been updated from projects to perimeters while correctly maintaining the Indonesian translation "Proyek".


122-122: LGTM! Key renamed while preserving the translation.

The key has been updated from project to perimeter while correctly maintaining the Indonesian translation "Proyek".


190-190: LGTM! Key renamed while preserving the translation.

The key has been updated from myProjects to myPerimeters while correctly maintaining the Indonesian translation "Proyek saya".


192-192: LGTM! Key renamed while preserving the translation.

The key has been updated from assignedProjects to assignedPerimeters while correctly maintaining the Indonesian translation "Ditugaskan ke {number} proyek{s}".


Line range hint 214-215: LGTM! Updated terminology in description while maintaining context.

The description has been updated to use "perimeters" instead of "projects" while maintaining the clear explanation of the composer functionality.


227-227: LGTM! Key renamed while preserving the translation.

The key has been updated from projectsSummaryEmpty to perimetersSummaryEmpty while correctly maintaining the Indonesian translation "Ringkasan proyek kosong".

frontend/messages/en.json (10)

28-28: LGTM! Consistent terminology update.

The key and value have been updated from project to perimeter terminology.


41-41: LGTM! Consistent terminology update.

The key and value have been updated from project to perimeter terminology.


83-83: LGTM! Consistent terminology update.

The key and value have been updated from project to perimeter terminology.


121-121: LGTM! Consistent terminology update.

The key and value have been updated from project to perimeter terminology.


189-189: LGTM! Consistent terminology update.

The key and value have been updated from project to perimeter terminology.


191-191: LGTM! Consistent terminology update.

The key and value have been updated from project to perimeter terminology while maintaining the dynamic placeholder format.


214-215: LGTM! Updated terminology in description while maintaining clarity.

The composer description has been updated to use "perimeters" instead of "projects" while maintaining clear explanation of the functionality and use cases.


226-226: LGTM! Consistent terminology update.

The key and value have been updated from project to perimeter terminology.


767-767: LGTM! Consistent terminology update.

The error message has been updated to use "perimeter" terminology.


1102-1103: LGTM! Updated tour descriptions with new terminology.

The tour descriptions have been updated to use "perimeter" terminology while maintaining clear guidance for users.

@@ -15,7 +15,7 @@
FRAMEWORKS_ENDPOINT = "frameworks-list"
STORED_LIBRARIES_ENDPOINT = "stored-libraries-list"
RISK_MATRICES_ENDPOINT = "risk-matrices-list"
PROJECTS_ENDPOINT = "projects-list"
PERIMETERS_ENDPOINT = "perimeter-list"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Update test_api_perimeters.py to use PERIMETERS_ENDPOINT constant

The endpoint has proper test coverage with both authenticated and unauthenticated test cases. However, the test file should be updated to use the PERIMETERS_ENDPOINT constant from test_vars.py instead of the hardcoded "Perimeters" string for consistency.

  • Update backend/app_tests/api/test_api_perimeters.py to:
    1. Import PERIMETERS_ENDPOINT from test_vars.py
    2. Replace all occurrences of "Perimeters" with PERIMETERS_ENDPOINT
🔗 Analysis chain

Verify test coverage for the new endpoint.

The PERIMETERS_ENDPOINT constant has been added correctly. However, we should ensure that all test cases previously using PROJECTS_ENDPOINT have been updated to use this new endpoint.

Let's check for any remaining references to the old endpoint:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining PROJECTS_ENDPOINT references
rg "PROJECTS_ENDPOINT" "backend/app_tests/"
# Search for any test files containing "project" in their names
fd -t f "test.*project" "backend/app_tests/"

Length of output: 86


Script:

#!/bin/bash
# Check directory structure
ls -R backend/

# Find all references to the new endpoint
rg "PERIMETERS_ENDPOINT" backend/

# List all test files
fd -e py "test_.*\.py$" backend/

Length of output: 12172


Script:

#!/bin/bash
# Check the content of perimeters test file
cat backend/app_tests/api/test_api_perimeters.py

# Also check if test_vars.py is imported in the test file
rg "from ..test_vars import" backend/app_tests/api/test_api_perimeters.py

Length of output: 5732

@@ -77,7 +77,7 @@
AppliedControl,
Evidence,
Framework,
Project,
Perimeter,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Remove duplicate imports.

The imports of Perimeter and PerimeterImportExportSerializer are duplicated. They are already imported at lines 19 and 48 respectively.

Apply this diff to remove the duplicate imports:

-    Perimeter,
     RiskAssessment,
     RiskMatrix,
     RiskScenario,
     ComplianceAssessment,
     RequirementAssessment,
     Vulnerability,
     Threat,
     ReferenceControl,
     LoadedLibrary,
)

from ebios_rm.models import (
     EbiosRMStudy,
     FearedEvent,
     RoTo,
     OperationalScenario,
     Stakeholder,
     StrategicScenario,
     AttackPath,
)

from tprm.models import Entity

from core.serializers import (
     FolderImportExportSerializer,
     AssetImportExportSerializer,
     AppliedControlImportExportSerializer,
     EvidenceImportExportSerializer,
-    PerimeterImportExportSerializer,
     RiskAssessmentImportExportSerializer,

Also applies to: 109-109

🧰 Tools
🪛 Ruff (0.8.2)

80-80: Redefinition of unused Perimeter from line 19

Remove definition: Perimeter

(F811)

Comment on lines +139 to 141
perimeter=Perimeter.objects.create(name="test", folder=folder),
risk_matrix=RiskMatrix.objects.create(name="test", folder=folder),
),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Additional test coverage needed for Perimeter model

The current test coverage is insufficient. The following test scenarios should be added:

  • Lifecycle state transitions through all states (undefined → in_design → in_dev → in_prod → eol/dropped)
  • Validation of Perimeter-RiskAssessment relationships
  • Deletion scenarios and their impact on related RiskAssessments

Specific files to update:

  • backend/app_tests/api/test_api_perimeters.py: Add lifecycle state transition tests
  • backend/app_tests/api/test_api_risk_assessments.py: Add Perimeter relationship tests
🔗 Analysis chain

Verify test coverage for Perimeter model transition.

The test cases have been updated to use the new Perimeter model instead of Project. While the changes look correct, ensure that all edge cases are covered:

  • Perimeter creation with various states
  • Perimeter relationships with RiskAssessment
  • Perimeter deletion scenarios

Let's verify the test coverage:

Also applies to: 172-174, 197-199, 215-217, 337-338, 342-343, 418-419

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check test coverage for Perimeter model and related functionality

# Check for any remaining references to 'project' in test files
echo "Checking for any remaining 'project' references in tests..."
rg -i 'project' backend/app_tests/

# Check test coverage patterns for Perimeter
echo "Checking test patterns for Perimeter model..."
rg -A 3 'def test.*perimeter' backend/app_tests/

Length of output: 3062


Script:

#!/bin/bash
# Check test implementations and relationships

# Check state/status handling in perimeter tests
echo "Checking state handling in perimeter tests..."
rg -A 10 'status.*=.*' backend/app_tests/api/test_api_perimeters.py

# Check RiskAssessment-Perimeter relationship tests
echo "Checking RiskAssessment-Perimeter relationship tests..."
rg -A 5 'RiskAssessment.*perimeter' backend/app_tests/

# Check deletion cascade tests
echo "Checking deletion cascade tests..."
rg -A 10 'delete.*cascade' backend/app_tests/
rg -A 10 'on_delete' backend/app_tests/

Length of output: 882


Script:

#!/bin/bash
# Check model definitions and additional tests

# Check Perimeter model definition
echo "Checking Perimeter model definition..."
rg -A 15 'class Perimeter' backend/

# Check RiskAssessment model definition
echo "Checking RiskAssessment model definition..."
rg -A 15 'class RiskAssessment' backend/

# Look for additional test files
echo "Checking for additional test files..."
fd test_.*py$ backend/app_tests/ | grep -v '__pycache__'

Length of output: 10648

Comment on lines 576 to 580
msgid "Perimeter"
msgstr "Projet"

#: core/models.py:1323
msgid "Projects"
msgid "Perimeters"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Update French translations for consistency.

The French translations still use "Projet" and "Projets" which is inconsistent with the perimeter refactoring:

msgid "Perimeter"
-msgstr "Projet"
+msgstr "Périmètre"

msgid "Perimeters"
-msgstr "Projets"
+msgstr "Périmètres"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
msgid "Perimeter"
msgstr "Projet"
#: core/models.py:1323
msgid "Projects"
msgid "Perimeters"
msgid "Perimeter"
msgstr "Périmètre"
#: core/models.py:1323
msgid "Perimeters"
msgstr "Périmètres"

@@ -25,7 +25,7 @@
"addComplianceAssessment": "ابدأ التدقيق",
"addEvidence": "أضف دليلًا",
"addDomain": "أضف نطاقًا",
"addProject": "أضف مشروعًا",
"addPerimeter": "أضف مشروعًا",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Update Arabic translations to use the equivalent of "perimeter" instead of "project".

While the keys have been updated from project to perimeter, the Arabic translations still use the word for "project" (مشروع). This inconsistency could confuse Arabic users as the UI will use "perimeter" in the code but display "project" in Arabic.

Consider updating these translations to use the Arabic equivalent of "perimeter" (محيط) for consistency with the new terminology:

-  "addPerimeter": "أضف مشروعًا",
+  "addPerimeter": "أضف محيطًا",
-  "associatedPerimeters": "المشاريع المرتبطة",
+  "associatedPerimeters": "المحيطات المرتبطة",
-  "perimeters": "المشاريع",
+  "perimeters": "المحيطات",
-  "perimeter": "المشروع",
+  "perimeter": "المحيط",
-  "myPerimeters": "مشاريعي",
+  "myPerimeters": "محيطاتي",
-  "assignedPerimeters": "مُعين إلى {number} مشروع",
+  "assignedPerimeters": "مُعين إلى {number} محيط",
-  "perimetersSummaryEmpty": "ملخص المشاريع فارغ",
+  "perimetersSummaryEmpty": "ملخص المحيطات فارغ"

Also applies to: 41-41, 82-82, 120-120, 188-188, 190-190, 225-225

@@ -25,7 +25,7 @@
"addComplianceAssessment": "नया ऑडिट",
"addEvidence": "साक्ष्य जोड़ें",
"addDomain": "डोमेन जोड़ें",
"addProject": "प्रोजेक्ट जोड़ें",
"addPerimeter": "प्रोजेक्ट जोड़ें",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Update Hindi translations to use perimeter terminology.

The Hindi translations still use "प्रोजेक्ट" (project) while the keys have been updated to use "perimeter". This creates an inconsistency in terminology between the application's internal representation and the user interface.

Consider updating the translations to use the Hindi equivalent of "perimeter" (e.g., "परिधि") to maintain consistency with the application's new terminology. Here's a suggested mapping:

-  "addPerimeter": "प्रोजेक्ट जोड़ें",
+  "addPerimeter": "परिधि जोड़ें",
-  "associatedPerimeters": "संबंधित प्रोजेक्ट",
+  "associatedPerimeters": "संबंधित परिधि",
-  "perimeters": "प्रोजेक्ट्स",
+  "perimeters": "परिधियाँ",
-  "perimeter": "प्रोजेक्ट",
+  "perimeter": "परिधि",
-  "myPerimeters": "मेरे प्रोजेक्ट",
+  "myPerimeters": "मेरी परिधियाँ",
-  "assignedPerimeters": "{number} प्रोजेक्ट{s} के लिए असाइन किया गया",
+  "assignedPerimeters": "{number} परिधि{s} के लिए असाइन किया गया",
-  "perimetersSummaryEmpty": "प्रोजेक्ट्स सारांश खाली है",
+  "perimetersSummaryEmpty": "परिधि सारांश खाली है"

Also applies to: 41-41, 81-81, 119-119, 187-187, 189-189, 224-224

@@ -25,7 +25,7 @@
"addComplianceAssessment": "Ny revision",
"addEvidence": "Lägg till bevis",
"addDomain": "Lägg till domän",
"addProject": "Lägg till projekt",
"addPerimeter": "Lägg till projekt",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Update Swedish translations to use perimeter terminology.

The Swedish translations still use "projekt" (project) while the keys have been updated to use "perimeter". This creates an inconsistency in terminology between the application's internal representation and the user interface.

Consider updating the translations to use the Swedish equivalent of "perimeter" (e.g., "perimeter" or "omkrets") to maintain consistency with the application's new terminology. Here's a suggested mapping:

-  "addPerimeter": "Lägg till projekt",
+  "addPerimeter": "Lägg till perimeter",
-  "associatedPerimeters": "Associerade projekt",
+  "associatedPerimeters": "Associerade perimetrar",
-  "perimeters": "Projekt",
+  "perimeters": "Perimetrar",
-  "perimeter": "Projekt",
+  "perimeter": "Perimeter",
-  "myPerimeters": "Mina projekt",
+  "myPerimeters": "Mina perimetrar",
-  "assignedPerimeters": "Tilldelad till {number} projekt{s}",
+  "assignedPerimeters": "Tilldelad till {number} perimeter{s}",
-  "perimetersSummaryEmpty": "Projektöversikten är tom",
+  "perimetersSummaryEmpty": "Perimeteröversikten är tom"

Also applies to: 41-41, 83-83, 121-121, 189-189, 191-191, 226-226

@@ -25,7 +25,7 @@
"addComplianceAssessment": "Démarrer l'audit",
"addEvidence": "Ajouter une preuve",
"addDomain": "Ajouter un domaine",
"addProject": "Ajouter un projet",
"addPerimeter": "Ajouter un projet",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Inconsistent terminology between keys and values

The keys have been updated to use "perimeter" terminology, but the corresponding French translations still use "projet". This creates an inconsistency between the application's data model and the user interface.

Apply this diff to align the terminology:

-	"addPerimeter": "Ajouter un projet",
+	"addPerimeter": "Ajouter un périmètre",
-	"associatedPerimeters": "Projets associés",
+	"associatedPerimeters": "Périmètres associés",
-	"perimeters": "Projets",
+	"perimeters": "Périmètres",
-	"perimeter": "Projet",
+	"perimeter": "Périmètre",
-	"myPerimeters": "Mes projets",
+	"myPerimeters": "Mes périmètres",
-	"assignedPerimeters": "Assigné à {number} projet{s}",
+	"assignedPerimeters": "Assigné à {number} périmètre{s}",
-	"perimetersSummaryEmpty": "Le résumé des projets est vide",
+	"perimetersSummaryEmpty": "Le résumé des périmètres est vide",

Also applies to: 41-41, 83-83, 121-121, 189-189, 191-191, 226-226

Comment on lines 1101 to 1102
"tourPerimetersDescription": "Les projets sont des périmètres fonctionnels au sein d'un domaine. Vous en aurez besoin d'au moins un. <br/><b>Cliquez dessus</b>.",
"tourPerimeterAddDescription": "C'est ici que vous pourrez créer un projet.",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Update tour messages to use consistent terminology

The guided tour messages still reference "projects" instead of "perimeters".

Apply this diff to maintain terminology consistency:

-	"tourPerimetersDescription": "Les projets sont des périmètres fonctionnels au sein d'un domaine. Vous en aurez besoin d'au moins un. <br/><b>Cliquez dessus</b>.",
+	"tourPerimetersDescription": "Les périmètres sont des zones fonctionnelles au sein d'un domaine. Vous en aurez besoin d'au moins un. <br/><b>Cliquez dessus</b>.",
-	"tourPerimeterAddDescription": "C'est ici que vous pourrez créer un projet.",
+	"tourPerimeterAddDescription": "C'est ici que vous pourrez créer un périmètre.",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"tourPerimetersDescription": "Les projets sont des périmètres fonctionnels au sein d'un domaine. Vous en aurez besoin d'au moins un. <br/><b>Cliquez dessus</b>.",
"tourPerimeterAddDescription": "C'est ici que vous pourrez créer un projet.",
"tourPerimetersDescription": "Les périmètres sont des zones fonctionnelles au sein d'un domaine. Vous en aurez besoin d'au moins un. <br/><b>Cliquez dessus</b>.",
"tourPerimeterAddDescription": "C'est ici que vous pourrez créer un périmètre.",

@ab-smith ab-smith changed the title feat!: rename project to perimeter to make room for upcoming new features feat!: rename project to perimeter as preparation for upcoming features Jan 29, 2025
@ab-smith ab-smith changed the title feat!: rename project to perimeter as preparation for upcoming features refactor!: rename project to perimeter as preparation for upcoming features Jan 29, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
backend/core/views.py (1)

251-251: Replace star imports with explicit imports.

The static analysis tool flags undefined imports from star imports. While the code works, explicit imports would improve maintainability.

Replace star imports with explicit imports:

- from .models import *
- from .serializers import *
+ from .models import Perimeter
+ from .serializers import PerimeterReadSerializer

Also applies to: 257-257, 262-262, 272-272, 274-274, 277-277, 309-309, 314-314, 345-345, 347-347, 980-980, 2607-2607, 2622-2622

🧰 Tools
🪛 Ruff (0.8.2)

251-251: Perimeter may be undefined, or defined from star imports

(F405)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b2a775f and fbdca9b.

📒 Files selected for processing (8)
  • backend/core/models.py (10 hunks)
  • backend/core/views.py (12 hunks)
  • frontend/messages/en.json (9 hunks)
  • frontend/messages/fr.json (7 hunks)
  • frontend/src/lib/components/Forms/ModelForm/ComplianceAssessmentForm.svelte (1 hunks)
  • frontend/src/lib/utils/crud.ts (7 hunks)
  • frontend/src/lib/utils/schemas.ts (5 hunks)
  • frontend/src/routes/(app)/(internal)/risk-assessments/[id=uuid]/+page.svelte (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • frontend/src/routes/(app)/(internal)/risk-assessments/[id=uuid]/+page.svelte
  • frontend/messages/fr.json
  • frontend/src/lib/components/Forms/ModelForm/ComplianceAssessmentForm.svelte
  • frontend/messages/en.json
🧰 Additional context used
🪛 Ruff (0.8.2)
backend/core/views.py

251-251: Perimeter may be undefined, or defined from star imports

(F405)


257-257: Perimeter may be undefined, or defined from star imports

(F405)


262-262: Perimeter may be undefined, or defined from star imports

(F405)


272-272: Perimeter may be undefined, or defined from star imports

(F405)


274-274: Perimeter may be undefined, or defined from star imports

(F405)


277-277: PerimeterReadSerializer may be undefined, or defined from star imports

(F405)


309-309: Perimeter may be undefined, or defined from star imports

(F405)


314-314: PerimeterReadSerializer may be undefined, or defined from star imports

(F405)


345-345: Perimeter may be undefined, or defined from star imports

(F405)


347-347: Perimeter may be undefined, or defined from star imports

(F405)


980-980: Perimeter may be undefined, or defined from star imports

(F405)


2607-2607: Perimeter may be undefined, or defined from star imports

(F405)


2622-2622: Perimeter may be undefined, or defined from star imports

(F405)

⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: enterprise-startup-functional-test (3.12)
  • GitHub Check: functional-tests (3.12, chromium)
  • GitHub Check: startup-docker-compose-test
  • GitHub Check: enterprise-functional-tests (3.12, chromium)
  • GitHub Check: enterprise-startup-docker-compose-test
🔇 Additional comments (15)
frontend/src/lib/utils/schemas.ts (3)

Line range hint 78-82: LGTM! Schema definition looks correct.

The PerimeterSchema maintains the same structure as the previous ProjectSchema, ensuring type safety and data validation.


99-99: LGTM! Foreign key references updated correctly.

The foreign key fields in both RiskAssessmentSchema and ComplianceAssessmentSchema have been updated from 'project' to 'perimeter'.

Also applies to: 272-272


495-495: LGTM! Schema mapping updated consistently.

The SCHEMA_MAP entry has been updated from 'projects' to 'perimeters', maintaining consistency with the schema renaming.

frontend/src/lib/utils/crud.ts (3)

155-157: LGTM! Foreign key relationships updated correctly.

The folder relationships have been updated to reference 'perimeters' instead of 'projects'.


159-172: LGTM! Model mapping definition is complete.

The perimeter model mapping includes all necessary fields:

  • Correct name and localization strings
  • Proper foreign key relationships
  • Appropriate filters

193-193: LGTM! Risk assessment relationships updated.

All references to 'project' in risk assessment mappings have been updated to 'perimeter'.

Also applies to: 202-202, 210-210

backend/core/models.py (6)

Line range hint 1351-1374: LGTM! Perimeter model definition is complete.

The Perimeter model maintains the same structure as the previous Project model with appropriate:

  • Fields and choices
  • Meta class configuration
  • Verbose names

2053-2057: LGTM! Assessment model relationship updated.

The foreign key relationship in the Assessment model has been updated to reference the Perimeter model.


2096-2096: LGTM! Folder assignment logic updated.

The folder assignment in the Assessment model's save method has been updated to use perimeter.folder.


2157-2157: LGTM! Display methods updated.

The path display and parent reference methods have been updated to use 'perimeter' terminology.

Also applies to: 2613-2616


897-898: LGTM! Property references updated.

The RiskMatrix model's property has been updated to reference Perimeter objects.


1890-1891: LGTM! Property references updated.

The AppliedControl model's property has been updated to reference perimeters.

backend/core/views.py (3)

Line range hint 246-351: LGTM! The PerimeterViewSet implementation is well-structured.

The class provides a comprehensive set of API endpoints for managing perimeters, with proper error handling, permission checks, and documentation.

🧰 Tools
🪛 Ruff (0.8.2)

251-251: Perimeter may be undefined, or defined from star imports

(F405)


257-257: Perimeter may be undefined, or defined from star imports

(F405)


262-262: Perimeter may be undefined, or defined from star imports

(F405)


272-272: Perimeter may be undefined, or defined from star imports

(F405)


274-274: Perimeter may be undefined, or defined from star imports

(F405)


277-277: PerimeterReadSerializer may be undefined, or defined from star imports

(F405)


298-298: RiskAssessmentReadSerializer may be undefined, or defined from star imports

(F405)


673-674: LGTM! The filterset fields have been correctly updated.

The field names have been properly renamed from "project" to "perimeter" to reflect the model changes.


980-980: ⚠️ Potential issue

Add error handling for Perimeter.objects.get() call.

The current implementation assumes the Perimeter object exists, which could lead to unhandled exceptions.

Add try-except block to handle DoesNotExist:

-    _fields["perimeter"] = Perimeter.objects.get(id=data["perimeter"])
+    try:
+        _fields["perimeter"] = Perimeter.objects.get(id=data["perimeter"])
+    except Perimeter.DoesNotExist:
+        raise ValidationError({"perimeter": "Perimeter does not exist"})

Likely invalid or redundant comment.

🧰 Tools
🪛 Ruff (0.8.2)

980-980: Perimeter may be undefined, or defined from star imports

(F405)

Comment on lines +2607 to +2608
_fields["perimeter"] = Perimeter.objects.get(
id=link_dump_database_ids.get(_fields["perimeter"])
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Add error handling for Perimeter.objects.get() calls.

Similar to line 980, these calls need error handling to gracefully handle cases where the Perimeter doesn't exist.

Add try-except blocks:

-    _fields["perimeter"] = Perimeter.objects.get(
-        id=link_dump_database_ids.get(_fields["perimeter"])
-    )
+    try:
+        perimeter_id = link_dump_database_ids.get(_fields["perimeter"])
+        _fields["perimeter"] = Perimeter.objects.get(id=perimeter_id)
+    except Perimeter.DoesNotExist:
+        raise ValidationError({"perimeter": "Perimeter does not exist"})

Also applies to: 2622-2623

🧰 Tools
🪛 Ruff (0.8.2)

2607-2607: Perimeter may be undefined, or defined from star imports

(F405)

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fbdca9b and 4130419.

📒 Files selected for processing (2)
  • backend/core/migrations/0051_rename_project_perimeter_alter_perimeter_options_and_more.py (1 hunks)
  • backend/tprm/migrations/0004_remove_entityassessment_project_and_more.py (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • backend/tprm/migrations/0004_remove_entityassessment_project_and_more.py
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: startup-functional-test (3.12)
  • GitHub Check: startup-docker-compose-test
  • GitHub Check: enterprise-startup-functional-test (3.12)
  • GitHub Check: functional-tests (3.12, chromium)
  • GitHub Check: build (3.12)
  • GitHub Check: enterprise-startup-docker-compose-test
  • GitHub Check: test (3.12)
  • GitHub Check: enterprise-functional-tests (3.12, chromium)
🔇 Additional comments (2)
backend/core/migrations/0051_rename_project_perimeter_alter_perimeter_options_and_more.py (2)

9-13: LGTM! Dependencies are properly ordered.

The migration correctly depends on previous migrations from 'core', 'iam', and 'tprm' apps, ensuring proper execution order.


35-35: Consider using PROTECT instead of CASCADE for deletion.

Both ForeignKey fields use CASCADE deletion, which means deleting a Perimeter will automatically delete all associated assessments. Consider if PROTECT would be more appropriate to prevent accidental data loss.

Let's check if there are any existing deletion constraints in the codebase:

Also applies to: 40-40

✅ Verification successful

Review Verification: Consistent CASCADE Usage for Perimeter Fields

  • The search results confirm that the core.perimeter foreign keys in both backend/core/migrations/0051_rename_project_perimeter_alter_perimeter_options_and_more.py and backend/tprm/migrations/0004_remove_entityassessment_project_and_more.py consistently use on_delete=django.db.models.deletion.CASCADE.
  • No instance of using PROTECT for the Perimeter relation was found, indicating that the cascade behavior is applied uniformly across the codebase.
  • If accidental deletion of assessments is a concern, switching to PROTECT might be worth a closer discussion; however, the current implementation appears intentional.
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for existing ForeignKey deletion constraints
rg -A 2 "on_delete.*\." backend/

Length of output: 45849

Comment on lines 16 to 41
migrations.RenameModel(
old_name='Project',
new_name='Perimeter',
),
migrations.AlterModelOptions(
name='perimeter',
options={'verbose_name': 'Perimeter', 'verbose_name_plural': 'Perimeters'},
),
migrations.RemoveField(
model_name='complianceassessment',
name='project',
),
migrations.RemoveField(
model_name='riskassessment',
name='project',
),
migrations.AddField(
model_name='complianceassessment',
name='perimeter',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='core.perimeter', verbose_name='Perimeter'),
),
migrations.AddField(
model_name='riskassessment',
name='perimeter',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='core.perimeter', verbose_name='Perimeter'),
),
Copy link

@coderabbitai coderabbitai bot Feb 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Critical: Add a data migration step to preserve relationships.

This migration will result in data loss as it removes the 'project' fields and adds new 'perimeter' fields without transferring the existing relationships. The new 'perimeter' fields will start as NULL.

Consider splitting this into three migrations:

  1. Add the new 'perimeter' fields
  2. Copy data from 'project' to 'perimeter'
  3. Remove the old 'project' fields

Here's an example data migration step:

def migrate_project_to_perimeter(apps, schema_editor):
    ComplianceAssessment = apps.get_model('core', 'ComplianceAssessment')
    RiskAssessment = apps.get_model('core', 'RiskAssessment')
    
    # Migrate ComplianceAssessment relationships
    for assessment in ComplianceAssessment.objects.all():
        assessment.perimeter = assessment.project
        assessment.save()
    
    # Migrate RiskAssessment relationships
    for assessment in RiskAssessment.objects.all():
        assessment.perimeter = assessment.project
        assessment.save()

class Migration(migrations.Migration):
    dependencies = [
        ('core', '0050_appliedcontrol_progress_field'),
    ]

    operations = [
        # First rename the model
        migrations.RenameModel(
            old_name='Project',
            new_name='Perimeter',
        ),
        migrations.AlterModelOptions(
            name='perimeter',
            options={'verbose_name': 'Perimeter', 'verbose_name_plural': 'Perimeters'},
        ),
        # Then add new fields
        migrations.AddField(
            model_name='complianceassessment',
            name='perimeter',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='core.perimeter', verbose_name='Perimeter'),
        ),
        migrations.AddField(
            model_name='riskassessment',
            name='perimeter',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='core.perimeter', verbose_name='Perimeter'),
        ),
        # Run data migration
        migrations.RunPython(migrate_project_to_perimeter),
        # Finally remove old fields
        migrations.RemoveField(
            model_name='complianceassessment',
            name='project',
        ),
        migrations.RemoveField(
            model_name='riskassessment',
            name='project',
        ),
    ]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good rabbit

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nas-tabchiche Thank you for the feedback! I'm glad I could help with the migration strategy. Let me know if you need any further assistance!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC we could get the same output without the data migration by using migrations.RenameField instead of adding the perimeter field, running the data migration, and then removing the old project field. Does this assumption sound right ot you?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nas-tabchiche Yes, you're absolutely right! Using migrations.RenameField would be a much better approach. It's a more elegant solution that handles the field renaming at the database level while automatically preserving all existing data and relationships. Here's how the migration could be simplified:

class Migration(migrations.Migration):
    dependencies = [
        ('core', '0050_appliedcontrol_progress_field'),
        ('iam', '0010_user_preferences'),
        ('tprm', '0003_entityassessment_representatives'),
    ]

    operations = [
        migrations.RenameModel(
            old_name='Project',
            new_name='Perimeter',
        ),
        migrations.AlterModelOptions(
            name='perimeter',
            options={'verbose_name': 'Perimeter', 'verbose_name_plural': 'Perimeters'},
        ),
        migrations.RenameField(
            model_name='complianceassessment',
            old_name='project',
            new_name='perimeter',
        ),
        migrations.RenameField(
            model_name='riskassessment',
            old_name='project',
            new_name='perimeter',
        ),
    ]

This is much cleaner and safer than the previous approach with explicit data migration.


✏️ Learnings added
Learnt from: nas-tabchiche
PR: intuitem/ciso-assistant-community#1446
File: backend/core/migrations/0051_rename_project_perimeter_alter_perimeter_options_and_more.py:0-0
Timestamp: 2025-02-04T08:29:42.620Z
Learning: Using `migrations.RenameField` is preferred over add-migrate-remove pattern when renaming fields in Django as it preserves data and relationships at the database level without requiring explicit data migration.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (15)
backend/core/views.py (1)

94-95: Replace star imports with explicit imports.

Star imports (*) make it unclear where symbols are coming from and can lead to naming conflicts. Consider explicitly importing the required models and serializers:

-from .models import *
-from .serializers import *
+from .models import Perimeter, Asset, Threat, RiskMatrix, RiskScenario, ...
+from .serializers import PerimeterReadSerializer, RiskAssessmentReadSerializer, ...
🧰 Tools
🪛 Ruff (0.8.2)

94-94: from .models import * used; unable to detect undefined names

(F403)


95-95: from .serializers import * used; unable to detect undefined names

(F403)

frontend/messages/pt.json (7)

28-28: Check Translation Consistency for "addPerimeter" Key
The key has been renamed to "addPerimeter" as intended; however, the translation value remains "Adicionar projeto". If the objective is to fully reflect the renaming from “project” to “perimeter”, consider updating the value to something like "Adicionar perímetro".


41-41: Verify "associatedPerimeters" Translation
The key "associatedPerimeters" is updated, but its corresponding value is still "Projetos associados". For consistency with the new naming, it would be advisable to update the translation to reflect “perímetros” (e.g., "Perímetros associados") unless the current terminology is deliberate.


81-81: Review "perimeters" Translation Value
The key "perimeters" has been changed, yet the translation value reads "Projetos". Please confirm whether the intended end-user terminology should switch to "Perímetros" to maintain consistency with the new naming strategy.


119-119: Recheck "perimeter" Translation
The key "perimeter" now appears in the code, but its translation remains "Projeto". Consider updating this to "Perímetro" to accurately communicate the new naming convention throughout the application.


187-187: Ensure Consistency for "myPerimeters" Key
The new key "myPerimeters" is present; however, the translation still uses "Meus projetos". It is recommended to update this text (for example, to "Meus perímetros") so that it aligns with the overall project-to-perimeter renaming.


189-189: Check "assignedPerimeters" Translation
The key "assignedPerimeters" has been updated, but its value remains "Atribuído a {number} projeto{s}". For full consistency, consider modifying the translation to "Atribuído a {number} perímetro{s}" if that suits the new usage context.


224-224: Review "perimetersSummaryEmpty" Translation
The key "perimetersSummaryEmpty" aligns with the renaming; however, its translation is still "O resumo do projeto está vazio". Updating it to, for example, "O resumo do perímetro está vazio" would ensure consistent communication of the updated terminology.

frontend/messages/it.json (7)

28-28: Verifica Coerenza Traduzione per "addPerimeter"
La chiave è stata rinominata in "addPerimeter", tuttavia il valore della traduzione rimane "Aggiungi progetto". Se l’obiettivo è riflettere pienamente il passaggio da “project” a “perimeter”, prendi in considerazione l’aggiornamento del testo in "Aggiungi perimetro".


41-41: Verifica Traduzione di "associatedPerimeters"
La chiave "associatedPerimeters" è stata aggiornata, ma il valore associato è ancora "Progetti associati". Per mantenere la coerenza con il nuovo naming, valuta la possibilità di modificare il testo in "Perimetri associati" se rispecchia correttamente la terminologia prevista.


81-81: Controlla Traduzione per "perimeters"
Il valore attuale per la chiave "perimeters" è "Progetti", il che non rispecchia il cambiamento. Verifica se va aggiornato a "Perimetri" per essere in linea con il refactoring effettuato.


119-119: Rivedere Traduzione di "perimeter"
Nonostante la rinomina della chiave a "perimeter", il valore rimane "Progetto". Se il nuovo modello deve comunicare il concetto di “perimeter” anche in italiano, considera la modifica in "Perimetro".


187-187: Verifica Traduzione per "myPerimeters"
La chiave "myPerimeters" compare ora, ma il suo valore è ancora "I miei progetti". Potrebbe essere più coerente aggiornare questo in "I miei perimetri", in linea con la nuova nomenclatura.


189-189: Controllare Traduzione di "assignedPerimeters"
Il valore per "assignedPerimeters" è attualmente "Assegnato al progetto{i} {number}", utilizzando ancora il termine “progetto”. Se la nuova terminologia è quella desiderata, si suggerisce di cambiarlo in "Assegnato al perimetro{i} {number}" per garantire coerenza.


224-224: Verifica Traduzione per "perimetersSummaryEmpty"
La chiave "perimetersSummaryEmpty" appare correttamente rinominata, ma il valore "Riepilogo del progetto" non riflette pienamente il cambiamento. Considera di aggiornarlo in "Riepilogo del perimetro" per uniformare la terminologia.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 225ab3c and 3b19709.

📒 Files selected for processing (25)
  • backend/core/models.py (10 hunks)
  • backend/core/views.py (12 hunks)
  • frontend/messages/ar.json (6 hunks)
  • frontend/messages/cs.json (6 hunks)
  • frontend/messages/de.json (6 hunks)
  • frontend/messages/en.json (9 hunks)
  • frontend/messages/es.json (6 hunks)
  • frontend/messages/fr.json (7 hunks)
  • frontend/messages/hi.json (6 hunks)
  • frontend/messages/it.json (6 hunks)
  • frontend/messages/nl.json (8 hunks)
  • frontend/messages/pl.json (6 hunks)
  • frontend/messages/pt.json (6 hunks)
  • frontend/messages/ro.json (6 hunks)
  • frontend/messages/sv.json (6 hunks)
  • frontend/messages/ur.json (6 hunks)
  • frontend/src/lib/components/DetailView/DetailView.svelte (1 hunks)
  • frontend/src/lib/components/Forms/ModelForm/ComplianceAssessmentForm.svelte (1 hunks)
  • frontend/src/lib/components/Forms/ModelForm/RiskAcceptanceForm.svelte (1 hunks)
  • frontend/src/lib/utils/schemas.ts (5 hunks)
  • frontend/src/routes/(app)/(internal)/[model=urlmodel]/[id=uuid]/+page.server.ts (1 hunks)
  • frontend/tests/functional/detailed/compliance-assessments.test.ts (1 hunks)
  • frontend/tests/functional/user-route.test.ts (5 hunks)
  • frontend/tests/utils/test-data.ts (11 hunks)
  • frontend/tests/utils/test-utils.ts (11 hunks)
🚧 Files skipped from review as they are similar to previous changes (18)
  • frontend/tests/functional/detailed/compliance-assessments.test.ts
  • frontend/src/lib/components/Forms/ModelForm/RiskAcceptanceForm.svelte
  • frontend/tests/functional/user-route.test.ts
  • frontend/src/routes/(app)/(internal)/[model=urlmodel]/[id=uuid]/+page.server.ts
  • frontend/src/lib/components/DetailView/DetailView.svelte
  • frontend/messages/de.json
  • frontend/messages/ro.json
  • frontend/messages/ur.json
  • frontend/messages/es.json
  • frontend/messages/ar.json
  • frontend/messages/hi.json
  • frontend/messages/nl.json
  • frontend/messages/fr.json
  • frontend/messages/cs.json
  • frontend/messages/en.json
  • frontend/messages/sv.json
  • frontend/tests/utils/test-data.ts
  • frontend/messages/pl.json
🧰 Additional context used
🪛 Ruff (0.8.2)
backend/core/views.py

251-251: Perimeter may be undefined, or defined from star imports

(F405)


257-257: Perimeter may be undefined, or defined from star imports

(F405)


262-262: Perimeter may be undefined, or defined from star imports

(F405)


272-272: Perimeter may be undefined, or defined from star imports

(F405)


274-274: Perimeter may be undefined, or defined from star imports

(F405)


277-277: PerimeterReadSerializer may be undefined, or defined from star imports

(F405)


309-309: Perimeter may be undefined, or defined from star imports

(F405)


314-314: PerimeterReadSerializer may be undefined, or defined from star imports

(F405)


345-345: Perimeter may be undefined, or defined from star imports

(F405)


347-347: Perimeter may be undefined, or defined from star imports

(F405)


980-980: Perimeter may be undefined, or defined from star imports

(F405)


2620-2620: Perimeter may be undefined, or defined from star imports

(F405)


2635-2635: Perimeter may be undefined, or defined from star imports

(F405)

🪛 Biome (1.9.4)
frontend/tests/utils/test-utils.ts

[error] 484-484: Expected an expression but instead found '==='.

Expected an expression here.

(parse)


[error] 484-484: Expected an expression but instead found '='.

Expected an expression here.

(parse)


[error] 485-485: expected , but instead found :

Remove :

(parse)


[error] 481-485: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)


[error] 551-551: Invalid regex flag

This is not a valid regex flag.

(parse)


[error] 551-551: Expected a semicolon or an implicit semicolon after a statement, but found none

An explicit or implicit semicolon is expected here...

...Which is required to end this statement

(parse)


[error] 551-551: Expected a semicolon or an implicit semicolon after a statement, but found none

An explicit or implicit semicolon is expected here...

...Which is required to end this statement

(parse)


[error] 551-578: This code is unreachable

... because this statement will return from the function beforehand

(lint/correctness/noUnreachable)


[error] 551-551: This block statement doesn't serve any purpose and can be safely removed.

Standalone block statements without any block-level declarations are redundant in JavaScript and can be removed to simplify the code.
Safe fix: Remove redundant block.

(lint/complexity/noUselessLoneBlockStatements)


[error] 551-551: This block statement doesn't serve any purpose and can be safely removed.

Standalone block statements without any block-level declarations are redundant in JavaScript and can be removed to simplify the code.
Safe fix: Remove redundant block.

(lint/complexity/noUselessLoneBlockStatements)


[error] 551-551: This block statement doesn't serve any purpose and can be safely removed.

Standalone block statements without any block-level declarations are redundant in JavaScript and can be removed to simplify the code.
Safe fix: Remove redundant block.

(lint/complexity/noUselessLoneBlockStatements)


[error] 578-578: Expected a semicolon or an implicit semicolon after a statement, but found none

An explicit or implicit semicolon is expected here...

...Which is required to end this statement

(parse)


[error] 578-578: Expected a semicolon or an implicit semicolon after a statement, but found none

An explicit or implicit semicolon is expected here...

...Which is required to end this statement

(parse)


[error] 578-578: Invalid regex flag

This is not a valid regex flag.

(parse)


[error] 578-578: Expected a semicolon or an implicit semicolon after a statement, but found none

An explicit or implicit semicolon is expected here...

...Which is required to end this statement

(parse)


[error] 578-578: Expected a semicolon or an implicit semicolon after a statement, but found none

An explicit or implicit semicolon is expected here...

...Which is required to end this statement

(parse)


[error] 578-578: unterminated regex literal

...but the line ends here

a regex literal starts there...

(parse)


[error] 551-578: This code is unreachable

... because this statement will return from the function beforehand

(lint/correctness/noUnreachable)


[error] 578-578: This block statement doesn't serve any purpose and can be safely removed.

Standalone block statements without any block-level declarations are redundant in JavaScript and can be removed to simplify the code.
Safe fix: Remove redundant block.

(lint/complexity/noUselessLoneBlockStatements)


[error] 578-578: This block statement doesn't serve any purpose and can be safely removed.

Standalone block statements without any block-level declarations are redundant in JavaScript and can be removed to simplify the code.
Safe fix: Remove redundant block.

(lint/complexity/noUselessLoneBlockStatements)


[error] 578-578: This block statement doesn't serve any purpose and can be safely removed.

Standalone block statements without any block-level declarations are redundant in JavaScript and can be removed to simplify the code.
Safe fix: Remove redundant block.

(lint/complexity/noUselessLoneBlockStatements)

🪛 GitHub Actions: Frontend Linters
frontend/tests/utils/test-utils.ts

[error] 484-484: Merge conflict marker encountered.

⏰ Context from checks skipped due to timeout of 90000ms (9)
  • GitHub Check: Analyze (python)
  • GitHub Check: startup-functional-test (3.12)
  • GitHub Check: startup-docker-compose-test
  • GitHub Check: enterprise-startup-functional-test (3.12)
  • GitHub Check: functional-tests (3.12, chromium)
  • GitHub Check: enterprise-functional-tests (3.12, chromium)
  • GitHub Check: test (3.12)
  • GitHub Check: build (3.12)
  • GitHub Check: enterprise-startup-docker-compose-test
🔇 Additional comments (10)
backend/core/views.py (3)

246-265: LGTM! Class renamed from ProjectViewSet to PerimeterViewSet.

The renaming is consistent with the PR objectives and the implementation maintains proper model and field definitions.

🧰 Tools
🪛 Ruff (0.8.2)

251-251: Perimeter may be undefined, or defined from star imports

(F405)


257-257: Perimeter may be undefined, or defined from star imports

(F405)


262-262: Perimeter may be undefined, or defined from star imports

(F405)


673-674: LGTM! Updated filterset fields to use perimeter instead of project.

The field name changes are consistent with the project to perimeter renaming.


1559-1560: LGTM! Updated filterset fields to use perimeter instead of project.

The field name changes are consistent with the project to perimeter renaming.

frontend/src/lib/components/Forms/ModelForm/ComplianceAssessmentForm.svelte (1)

62-70: LGTM! Project to Perimeter renaming is correctly implemented.

The AutocompleteSelect component has been properly updated to use 'perimeter' instead of 'project' across all its props.

frontend/src/lib/utils/schemas.ts (1)

78-83: LGTM! Schema definitions correctly updated for the project to perimeter transition.

All schema definitions have been consistently updated to use 'perimeter' instead of 'project':

  • PerimeterSchema (formerly ProjectSchema)
  • RiskAssessmentSchema
  • ComplianceAssessmentSchema

Also applies to: 96-100, 268-273, 492-496

frontend/tests/utils/test-utils.ts (1)

371-386: LGTM! Test utilities updated for perimeter-based testing.

The test utilities have been properly updated to reflect the project to perimeter transition:

  • Page definitions
  • Test fixtures
  • Path constructions

Also applies to: 478-491, 522-535, 545-568

backend/core/models.py (4)

1351-1351: Class renaming looks good!

The renaming from Project to Perimeter is consistent, including the Meta class verbose names.

Also applies to: 1373-1374


897-898: Property and method updates are consistent!

All references to "project" have been properly updated to "perimeter" in properties and methods while maintaining the same functionality.

Also applies to: 1890-1891, 2053-2058, 2613-2616


2096-2096: String updates are consistent!

The path display and folder assignment references have been properly updated to use "perimeter" instead of "project".

Also applies to: 2157-2157


1-3557: Verify no references to "project" were missed.

Let's verify that all necessary references to "project" have been renamed to "perimeter".

✅ Verification successful

Final Verification: No stray "project" references detected.

After re-running a refined search across the Python codebase without excluding patterns, no unintended references to "project" were found. All occurrences were either benign comments or properly replaced.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search for any remaining references to "project" that might need to be renamed.
# Note: Some occurrences might be legitimate (e.g., in comments or unrelated contexts)

# Search for "project" case-insensitively, excluding common legitimate uses
rg -i "project" \
  --type py \
  --glob '!**/migrations/**' \
  -v "PMBOK project management" \
  -v "# PR" \
  -v "#.*project" \
  -v "project_management" \
  -v "ProjectManager" \
  -v "//.*project"

Length of output: 492

🧰 Tools
🪛 Ruff (0.8.2)

9-9: rest_framework.renderers.status imported but unused

Remove unused import: rest_framework.renderers.status

(F401)


153-153: Use _name if _name else "" instead of "" if not _name else _name

Replace with _name if _name else ""

(SIM212)


436-436: Do not use bare except

(E722)


773-775: Return the condition not self.requirements.count() > 0 directly

Replace with return not self.requirements.count() > 0

(SIM103)


841-843: Return the negated condition directly

Inline condition

(SIM103)


975-977: Return the condition not self.compliance_assessment_set.count() > 0 directly

Replace with return not self.compliance_assessment_set.count() > 0

(SIM103)


1805-1805: Redefinition of unused status from line 9

(F811)


1993-1993: Redefinition of unused status from line 9

(F811)


2067-2067: Redefinition of unused status from line 9

(F811)


2275-2283: Use a single if statement instead of nested if statements

(SIM102)


2296-2297: Use a single if statement instead of nested if statements

(SIM102)


2321-2321: Use mtg["status"] != "active" instead of not mtg["status"] == "active"

Replace with != operator

(SIM201)


2331-2332: Use a single if statement instead of nested if statements

(SIM102)


2331-2331: Use mtg["status"] != "active" instead of not mtg["status"] == "active"

Replace with != operator

(SIM201)


3041-3041: Import status from line 9 shadowed by loop variable

(F402)


3311-3311: Redefinition of unused status from line 9

(F811)

Comment on lines 484 to 485
=======
perimeter: vars.folderName + '/' + vars.perimeterName,
// status: 'Planned',
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Resolve merge conflict markers.

There are unresolved merge conflict markers in the file that need to be removed:

=======
					perimeter: vars.folderName + '/' + vars.perimeterName,

Please resolve the merge conflict and ensure the correct version of the code is kept.

🧰 Tools
🪛 Biome (1.9.4)

[error] 484-484: Expected an expression but instead found '==='.

Expected an expression here.

(parse)


[error] 484-484: Expected an expression but instead found '='.

Expected an expression here.

(parse)


[error] 485-485: expected , but instead found :

Remove :

(parse)

🪛 GitHub Actions: Frontend Linters

[error] 484-484: Merge conflict marker encountered.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
backend/serdes/utils.py (1)

476-500: Consider reordering the return dictionary keys alphabetically.

The dictionary keys are not in alphabetical order, which can make maintenance more difficult. Consider reordering them for better readability and maintainability.

Apply this diff to reorder the keys:

     return {
-        # "folder": folders,
-        "loadedlibrary": loaded_libraries,
-        "vulnerability": vulnerabilities,
-        "framework": frameworks,
-        "riskmatrix": risk_matrices,
-        "referencecontrol": reference_controls,
-        "threat": threats,
-        "asset": assets,
-        "appliedcontrol": applied_controls,
-        "entity": entities,
-        "evidence": evidences,
-        "perimeter": perimeters,
-        "complianceassessment": compliance_assessments,
-        "requirementassessment": requirement_assessments,
-        "ebiosrmstudy": ebios_rm_studies,
-        "riskassessment": risk_assessments,
-        "riskscenario": risk_scenarios,
-        "fearedevent": feared_events,
-        "roto": ro_tos,
-        "operationalscenario": operational_scenarios,
-        "stakeholder": stakeholders,
-        "strategicscenario": strategic_scenarios,
-        "attackpath": attack_paths,
+        "appliedcontrol": applied_controls,
+        "asset": assets,
+        "attackpath": attack_paths,
+        "complianceassessment": compliance_assessments,
+        "ebiosrmstudy": ebios_rm_studies,
+        "entity": entities,
+        "evidence": evidences,
+        "fearedevent": feared_events,
+        "framework": frameworks,
+        "loadedlibrary": loaded_libraries,
+        "operationalscenario": operational_scenarios,
+        "perimeter": perimeters,
+        "referencecontrol": reference_controls,
+        "requirementassessment": requirement_assessments,
+        "riskassessment": risk_assessments,
+        "riskmatrix": risk_matrices,
+        "riskscenario": risk_scenarios,
+        "roto": ro_tos,
+        "stakeholder": stakeholders,
+        "strategicscenario": strategic_scenarios,
+        "threat": threats,
+        "vulnerability": vulnerabilities,
     }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b410460 and eec8f89.

📒 Files selected for processing (15)
  • backend/core/locale/fr/LC_MESSAGES/django.po (3 hunks)
  • backend/serdes/utils.py (6 hunks)
  • frontend/messages/ar.json (6 hunks)
  • frontend/messages/cs.json (6 hunks)
  • frontend/messages/de.json (6 hunks)
  • frontend/messages/es.json (6 hunks)
  • frontend/messages/fr.json (7 hunks)
  • frontend/messages/hi.json (6 hunks)
  • frontend/messages/id.json (6 hunks)
  • frontend/messages/it.json (6 hunks)
  • frontend/messages/pl.json (6 hunks)
  • frontend/messages/pt.json (6 hunks)
  • frontend/messages/ro.json (6 hunks)
  • frontend/messages/sv.json (6 hunks)
  • frontend/messages/ur.json (6 hunks)
🚧 Files skipped from review as they are similar to previous changes (11)
  • backend/core/locale/fr/LC_MESSAGES/django.po
  • frontend/messages/pt.json
  • frontend/messages/it.json
  • frontend/messages/pl.json
  • frontend/messages/es.json
  • frontend/messages/id.json
  • frontend/messages/de.json
  • frontend/messages/ro.json
  • frontend/messages/cs.json
  • frontend/messages/sv.json
  • frontend/messages/hi.json
🧰 Additional context used
🪛 GitHub Actions: Frontend Linters
frontend/messages/ar.json

[warning] Code style issues found in the above file. Run Prettier with --write to fix.

⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: startup-functional-test (3.12)
  • GitHub Check: startup-docker-compose-test
  • GitHub Check: enterprise-startup-docker-compose-test
  • GitHub Check: functional-tests (3.12, chromium)
  • GitHub Check: enterprise-functional-tests (3.12, chromium)
  • GitHub Check: enterprise-startup-functional-test (3.12)
  • GitHub Check: build (3.12)
  • GitHub Check: test (3.12)
🔇 Additional comments (25)
frontend/messages/ur.json (7)

28-28: Updated Key Name: "addPerimeter"
The key has been correctly renamed from "addProject" to "addPerimeter" with an appropriate Urdu translation. This change aligns with the overall renaming strategy.


41-41: Updated Key Name: "associatedPerimeters"
The key change from "associatedProjects" to "associatedPerimeters" is clear and consistent with the refactoring objectives.


81-81: Updated Key Name: "perimeters"
The plural key "perimeters" now properly reflects the new terminology. The translation "پیریمیٹرز" appears to be consistently applied.


119-119: Review Translation for Key "perimeter"
The key "perimeter" is updated; however, its value "پیریمیٹرز" is identical to the plural form used elsewhere. Please verify that this value is appropriate for a singular context or if a distinct singular form is needed.


187-187: Updated Key Name: "myPerimeters"
The key "myPerimeters" is updated consistently with the new naming convention, and the translation "میرے پیریمیٹرز" maintains clarity.


189-189: Updated Key with Parameterization: "assignedPerimeters"
The key "assignedPerimeters" now includes parameter placeholders ({number} and {s}). Ensure that the i18n framework correctly interprets the pluralization and that these placeholders work as intended when rendering the string.


224-224: Updated Key Name: "perimetersSummaryEmpty"
The key "perimetersSummaryEmpty" has been updated to reflect the shift to "perimeter" terminology. The translation is consistent with the overall changes.

backend/serdes/utils.py (3)

19-19: Remove duplicate import.

The Perimeter import is duplicated at line 80. This was flagged in a previous review.


152-152: LGTM!

The model-to-serializer mapping has been correctly updated to use Perimeter instead of Project.


372-372: LGTM!

The queries have been correctly updated to use perimeter instead of project, maintaining the existing filtering logic and relationships.

Also applies to: 375-375, 406-406

frontend/messages/ar.json (7)

28-28: Update and Verify "addPerimeter" Key
The key "addPerimeter" is updated to use "أضف محيطًا", which correctly reflects the rebranding from “project” to “perimeter”. This is consistent with previous recommendations.

🧰 Tools
🪛 GitHub Actions: Frontend Linters

[warning] Code style issues found in the above file. Run Prettier with --write to fix.


41-41: Check "associatedPerimeters" Translation Consistency
The key "associatedPerimeters" now uses the value "المحيطات المرتبطة". This aligns with the new perimeter-centric model and matches earlier feedback.

🧰 Tools
🪛 GitHub Actions: Frontend Linters

[warning] Code style issues found in the above file. Run Prettier with --write to fix.


82-82: Validate "perimeters" Key Update
The plural key "perimeters" is now set to "المحيطات", ensuring that the terminology is uniformly updated throughout the UI.

🧰 Tools
🪛 GitHub Actions: Frontend Linters

[warning] Code style issues found in the above file. Run Prettier with --write to fix.


120-120: Confirm "perimeter" Singularity Update
The singular key "perimeter" has been updated to "المحيط", ensuring proper consistency between singular and plural forms.

🧰 Tools
🪛 GitHub Actions: Frontend Linters

[warning] Code style issues found in the above file. Run Prettier with --write to fix.


188-188: Verify "myPerimeters" Translation
The key "myPerimeters" is now rendered as "محيطاتي", which correctly personalizes the terminology for user-specific instances.

🧰 Tools
🪛 GitHub Actions: Frontend Linters

[warning] Code style issues found in the above file. Run Prettier with --write to fix.


190-190: Review "assignedPerimeters" Pluralization Format
The key "assignedPerimeters" has been updated with a pluralization format:
"مُعين إلى {number} {number, plural, one {محيط} other {محيطات}}".
This format properly handles singular/plural cases in Arabic.

🧰 Tools
🪛 GitHub Actions: Frontend Linters

[warning] Code style issues found in the above file. Run Prettier with --write to fix.


225-225: Ensure "perimetersSummaryEmpty" Accuracy
The summary message "ملخص المحيطات فارغ" for the key "perimetersSummaryEmpty" is correctly updated to reflect the new naming. Please confirm that this aligns with the overall UI design.

🧰 Tools
🪛 GitHub Actions: Frontend Linters

[warning] Code style issues found in the above file. Run Prettier with --write to fix.

frontend/messages/fr.json (8)

28-28: Ensure "addPerimeter" Translation Consistency
The key "addPerimeter" is now set to "Ajouter un périmètre", which accurately reflects the renaming initiative. This update is in line with the overall rebranding effort.


41-41: Validate "associatedPerimeters" Translation
The key "associatedPerimeters" now appears as "Périmètres associés", aligning the terminology in French with the new project direction.


83-83: Confirm "perimeters" Key Update
The plural key "perimeters" is updated to "Périmètres", ensuring consistency across the UI.


121-121: Review "perimeter" Key Translation
The singular key "perimeter" is now defined as "Périmètre", which is correct and maintains consistency with plural usage.


190-190: Check "myPerimeters" Translation
The key "myPerimeters" has been updated to "Mes périmètres", properly localizing the user-specific term.


192-192: Validate Pluralization in "assignedPerimeters"
The key "assignedPerimeters" is now represented as "Assigné à {number} périmètre{s}". Please verify that this pluralization conforms to the ICU MessageFormat standards expected by the application.


227-227: Review "perimetersSummaryEmpty" Message
The summary message "Le résumé des périmètres est vide" for "perimetersSummaryEmpty" has been updated appropriately. This change reflects the consistent shift in terminology across the codebase.


1101-1102: Update Tour Message Terminology
The tour messages "tourPerimetersDescription" and "tourPerimeterAddDescription" have been modified to describe perimeters instead of projects. The new texts—
"Les périmètres sont des contours fonctionnels au sein d'un domaine. Vous en aurez besoin d'au moins un. <br/><b>Cliquez dessus</b>."
"C'est ici que vous pourrez créer un périmètre."
—properly guide users in the context of the new perimeter-centric model.

prettier
ChatGPT hallucinated solution would probably not work anyway
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
frontend/messages/ur.json (2)

81-81: Verification of the "perimeters" Key.
The key now reads "perimeters" with the translation "پیریمیٹرز". Please verify that the plural form is intended here—if this key represents a list, the plural is appropriate; otherwise, consider whether a singular form is needed.


119-119: Check on Singular vs. Plural for "perimeter".
The key "project" is now renamed to "perimeter", but the translation provided is "پیریمیٹرز" (which appears plural). Confirm if the intended display is singular or plural. In many cases, a singular key should use a singular translation (for example, "پیریمیٹر") unless the context requires the plural form.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cd5e384 and 54b19da.

📒 Files selected for processing (15)
  • frontend/messages/ar.json (6 hunks)
  • frontend/messages/cs.json (6 hunks)
  • frontend/messages/de.json (6 hunks)
  • frontend/messages/en.json (9 hunks)
  • frontend/messages/es.json (6 hunks)
  • frontend/messages/fr.json (7 hunks)
  • frontend/messages/hi.json (6 hunks)
  • frontend/messages/id.json (6 hunks)
  • frontend/messages/it.json (6 hunks)
  • frontend/messages/nl.json (8 hunks)
  • frontend/messages/pl.json (6 hunks)
  • frontend/messages/pt.json (6 hunks)
  • frontend/messages/ro.json (6 hunks)
  • frontend/messages/sv.json (6 hunks)
  • frontend/messages/ur.json (6 hunks)
🚧 Files skipped from review as they are similar to previous changes (13)
  • frontend/messages/fr.json
  • frontend/messages/ro.json
  • frontend/messages/de.json
  • frontend/messages/cs.json
  • frontend/messages/pl.json
  • frontend/messages/es.json
  • frontend/messages/it.json
  • frontend/messages/pt.json
  • frontend/messages/en.json
  • frontend/messages/sv.json
  • frontend/messages/hi.json
  • frontend/messages/ar.json
  • frontend/messages/id.json
⏰ Context from checks skipped due to timeout of 90000ms (9)
  • GitHub Check: startup-functional-test (3.12)
  • GitHub Check: functional-tests (3.12, chromium)
  • GitHub Check: enterprise-startup-functional-test (3.12)
  • GitHub Check: enterprise-migrations-check (3.12)
  • GitHub Check: enterprise-functional-tests (3.12, chromium)
  • GitHub Check: startup-docker-compose-test
  • GitHub Check: enterprise-startup-docker-compose-test
  • GitHub Check: build (3.12)
  • GitHub Check: test (3.12)
🔇 Additional comments (13)
frontend/messages/nl.json (9)

28-28: Review Note on "addPerimeter" Key

The key has been correctly updated from "addProject" to "addPerimeter", and the Dutch translation ("Perimeter toevoegen") now reflects the new naming. Ensure that all UI components referencing this key are updated accordingly.


41-41: Review Note on "associatedPerimeters" Key

This change replaces "associatedProjects" with "associatedPerimeters", and the translation ("Geassocieerde perimeters") is consistent with the new terminology. Please verify that related views and components correctly display this message.


81-81: Review Note on "perimeters" Key

The plural form has been updated appropriately from "projects" to "perimeters". Make sure that this key is used consistently throughout the frontend wherever a collection of perimeters is referenced.


119-119: Review Note on "perimeter" Key

The singular term "perimeter" now replaces the old "project" key, and the translation ("Perimeter") is accurate. Confirm that this change is reflected in all interface elements that display a single perimeter entity.


187-187: Review Note on "myPerimeters" Key

The update from "myProjects" to "myPerimeters" (translated as "Mijn perimeters") aligns with the overall rebranding initiative. It would be good to ensure that dashboard or menu labels that use this key are also updated.


211-211: Review Note on "composerDescription" Key

The description text has been updated to reflect the change from projects to perimeters by using “perimeteren.” The message now reads:
"Dit zal je helpen meerdere componenten (perimeteren) samen te voegen om een samengestelde weergave van je risico te krijgen. Dit is vooral nuttig voor twee gebruiksscenario's."
Verify that the updated description remains clear and contextually appropriate.


212-212: Review Note on "composerDescription1" Key

The new text now refers to "perimeterdomeinen" instead of projectdomeinen. This change is consistent with the rebranding effort and helps maintain a uniform terminology across the application. Please ensure that this terminology is used elsewhere consistently.


223-223: Review Note on "perimetersSummaryEmpty" Key

The summary message has been updated from a project overview to a perimeter overview ("Perimeteroverzicht is leeg"). This is in line with the renaming objectives. Confirm that all overview screens and empty state displays are synchronized with this change.


755-755: Review Note on "xRaysEmptyMessage" Key

The message now requires at least one perimeter ("U moet minimaal één perimeter maken om röntgenstraling te kunnen gebruiken.") instead of one project. This correctly supports the new naming convention. Please check any downstream logic or conditional checks that rely on this key.

frontend/messages/ur.json (4)

28-28: Correct Renaming for "addPerimeter".
The key has been successfully renamed from "addProject" to "addPerimeter" with the corresponding Urdu translation "پیریمیٹر شامل کریں". This change is in line with the project refactoring objectives.


41-41: Consistent Update of "associatedPerimeters".
The key "associatedProjects" has been correctly updated to "associatedPerimeters" with the Urdu translation "وابستہ پیریمیٹرز". The translation and naming convention are consistent.


187-187: Accurate Update for "myPerimeters".
The key "myProjects" has been updated to "myPerimeters" along with the translation "میرے پیریمیٹرز". This is consistent with the new naming convention across the system.


223-223: Proper Renaming for "perimetersSummaryEmpty".
The key "projectsSummaryEmpty" has been refactored to "perimetersSummaryEmpty" with the updated translation "پیریمیٹرز کا خلاصہ خالی ہے". The change adheres to the overall project renaming effort.

Copy link
Collaborator

@Mohamed-Hacene Mohamed-Hacene left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0k

@Mohamed-Hacene Mohamed-Hacene merged commit 7e45701 into main Feb 5, 2025
21 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Feb 5, 2025
@Mohamed-Hacene Mohamed-Hacene deleted the feat/rename-project branch February 5, 2025 13:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants